Skip to content

Instantly share code, notes, and snippets.

Last active Dec 5, 2015
What would you like to do?
UpVPN (reconnect vpn when disconnected)
VPN="Sharif ID"
trap "exit 0" SIGINT SIGTERM
while true; do
if ! nmcli con status | grep -q "$VPN"; then
echo "[`date`] Disconnected. Trying to reconnect..."
nmcli -p con up id "$VPN"
sleep 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment