Skip to content

Instantly share code, notes, and snippets.

View Harold-D's full-sized avatar

Harold Harold-D

View GitHub Profile
@Harold-D
Harold-D / vpn-check.sh
Last active February 27, 2023 08:11
BusyBox ash (OpenWRT) script for checking connection to VPN host over VPN interface. Restarts OpenVPN if needed.
#!/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 () {