Skip to content

Commit

Permalink
Add reboot script if wrong IP
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Feb 19, 2017
1 parent 1fdf34d commit af8a902
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -100,6 +100,19 @@ config forwarding
option src 'lan'
```

to reboot after the connection is down, create (fill in your own IP at `IP_ISP`):
```
cat >> /etc/openvpn/checkvpn.sh << EOF
IP_ISP="87.1.1.1"
IP=`wget -qO- ifconfig.co`
if [ $IP == $IP_ISP ]; then
echo `date` >> reboot.log
reboot
fi
EOF
chmod +x /etc/openvpn/checkvpn.sh
```
open `crontab -e` and add `*/2 * * * * /root/checkvpn.sh`

Reboot:

Expand Down

0 comments on commit af8a902

Please sign in to comment.