Posted By

dbiesecke on 06/22/14


Tagged

unix restart cron pptp


Versions (?)

unix-cron-pptp-restart


 / Published in: Bash
 

make a cron like:

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

  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  

You need to login to post a comment.