Skip to content

Instantly share code, notes, and snippets.

@vinliao
Created December 24, 2019 11:18
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 vinliao/991cf08136a5865cc68d45da54f1ee19 to your computer and use it in GitHub Desktop.
Save vinliao/991cf08136a5865cc68d45da54f1ee19 to your computer and use it in GitHub Desktop.
#!/bin/bash
while true;
do
ping -c1 google.com
# if ping isn't successful
if [ $? -ne 0 ]
then
protonvpn c -r
# if first connect isn't succesful
# then connect again
while [ $? -ne 0 ];
do
protonvpn c -r
done
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment