#!/bin/bash [email protected] while true do ping -c 2 >/dev/null 2>&1 if [ $? -ne 0 ];then echo " |mail-s "ping baidu is down" $mail else echo "baidu is ok" fi; sleep 30 done
时间: 2024-10-07 21:20:38
#!/bin/bash [email protected] while true do ping -c 2 >/dev/null 2>&1 if [ $? -ne 0 ];then echo " |mail-s "ping baidu is down" $mail else echo "baidu is ok" fi; sleep 30 done