我有一个脚本检查pptp vpn是否正在运行,如果不是,它重新连接pptp vpn,当我手动运行脚本时它执行正常,当我设置一个cron作业时,没有运行
原文链接:https://www.f2er.com/bash/386894.html* * * * * /bin/bash /var/scripts/vpn-check.sh
脚本来了:
#!/bin/sh /bin/ping -c3 192.168.17.27 > /tmp/pingreport result=`grep "0 received" /tmp/pingreport` truncresult="`echo "$result" | sed 's/^\(.................................\).*$$'`" if [[ $truncresult == "3 packets transmitted,0 received" ]]; then /usr/sbin/pppd call home fi