[Shell] 纯文本查看 复制代码#!/bin/sh
tries=0
logger "my network watchdog start"
while [[ $tries -lt 5 ]]
do
if /bin/ping -c 1 8.8.8.8 >/dev/null
then
logger "network pass, exit."
exit 0
fi
tries=$((tries+1))
sleep 10
done
logger "network error, restart network"
/sbin/ifup wan
sh报错
dwcq.sh: line 15: syntax error: unexpected end of file (expecting "then")