/ Published in: Bash
make a cron like:
`*/5 * * * * root bash /root/vpn-check.sh`
`*/5 * * * * root bash /root/vpn-check.sh`
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/sh ping -c3 10.8.3.0 > pingreport result=`grep "0 received" pingreport` truncresult="`echo "$result" | sed 's/^\(.................................\).*$/\1/'`" if [[ $truncresult == "3 packets transmitted, 0 received" ]]; then pon company-vpn fi