Skip to content

Instantly share code, notes, and snippets.

@amiraliakbari
Forked from mjnaderi/upvpn.sh
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amiraliakbari/c32ad4706be5b8cd4559 to your computer and use it in GitHub Desktop.
Save amiraliakbari/c32ad4706be5b8cd4559 to your computer and use it in GitHub Desktop.
#!/bin/bash
VPN="Sharif ID"
trap "exit 0" SIGINT SIGTERM
while true; do
if ! nmcli con status | grep "$VPN" &>/dev/null; then
echo "[`date -R`] Trying to re-connect..."
nmcli -p con up id "$VPN"
fi
sleep 3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment