unix-cron-pptp-restart


/ Published in: Bash
Save to your folder(s)

make a cron like:

`*/5 * * * * root bash /root/vpn-check.sh`


Copy this code and paste it in your HTML
  1. #!/bin/sh
  2.  
  3. ping -c3 10.8.3.0 > pingreport
  4. result=`grep "0 received" pingreport`
  5. truncresult="`echo "$result" | sed 's/^\(.................................\).*$/\1/'`"
  6. if [[ $truncresult == "3 packets transmitted, 0 received" ]]; then
  7. pon company-vpn
  8. fi

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.