Guest User

Untitled

a guest
May 25th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. ping -c3 10.8.3.0 > pingreport
  2. result=`grep "0 received" pingreport`
  3. truncresult="`echo "$result" | sed 's/^(.................................).*$/1/'`"
  4. if [[ $truncresult == "3 packets transmitted, 0 received" ]]; then
  5. pon VPNname
  6. fi
  7.  
  8. */1 * * * * bash /root/vpn-check.sh > /root/cronlog.txt 2>&1
  9.  
  10. */1 * * * * /root/vpn-check.sh > /root/cronlog.txt 2>&1
  11.  
  12. */1 * * * * /usr/sbin/pppd call VPNname> /root/cronlog.txt 2>&1
  13.  
  14. crontab -e
  15.  
  16. SHELL=/bin/sh
  17. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  18.  
  19. #!/bin/bash
  20. ping -c3 10.8.3.0 > pingreport
  21. result=`grep "0 received" pingreport`
  22. truncresult="`echo "$result" | sed 's/^(.................................).*$/1/'`"
  23. if [[ $truncresult == "3 packets transmitted, 0 received" ]]; then
  24. pon VPNname
  25. fi
  26.  
  27. */1 * * * * root bash /root/vpn.sh
Add Comment
Please, Sign In to add comment