shell/用户检测域名.txt

15 lines
306 B
Plaintext
Raw Permalink Normal View History

2024-05-30 20:49:15 +08:00
#!/usr/bin/bash
#
#by fuxiaoshun 3/30
read -p "请输入域名:" name
time=`date +%F:%H:%M:%S`
ping -c1 $name
if [ $? -eq 0 ];then
echo "已通过,请查看/tmp/1.txt"
echo "通过时间已经记录" $time >>/tmp/1.txt
else
echo "不通过,请检查网络"
fi