Skip to content

Instantly share code, notes, and snippets.

Avatar

Harold Harold-D

View GitHub Profile
@Harold-D
Harold-D / vpn-check.sh
Last active December 1, 2018 10:18
BusyBox ash (OpenWRT) script for checking connection to VPN host over VPN interface. Restarts OpenVPN if needed.
View vpn-check.sh
#!/bin/ash
set -x #debugging
VPN_CHECK_LOG="/var/log/vpncheck.log"
VPN_SERVER="nl.privateinternetaccess.com"
VPN_INTERFACE="tun0"
INTERNET_INTERFACE="eth0"
# Check to see if the VPN server is ping-able
ping_success () {