Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## This script checks to see if the tun0 device exists within the transmission jail. If not, it restarts OpenVPN. I have this run as a CRON job every 20 minutes.
- currentDate=$(date "+%b %d %H:%M:%S")
- if iocage exec transmission ifconfig | grep -c "tun0" > /dev/null
- then
- echo "$currentDate VPN Check Successful. OpenVPN is still running." >> /var/log/messages
- else
- echo "$currentDate VPN Connection is down. Restarting OpenVPN." >> /var/log/messages
- iocage exec transmission service openvpn restart
- fi
Advertisement
Add Comment
Please, Sign In to add comment