Created
September 10, 2020 20:27
-
-
Save beothorn/aa3c5311674303925abc52d3ce203058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
nordvpn c | |
while [ true ]; do | |
if curl -s https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data | grep -q '"status":true'; then | |
echo "VPN is good $(date)" | |
sleep 1s | |
else | |
echo "VPN DOWN!!!!!!!!!" | |
echo "Shutting down internet" | |
nmcli networking off | |
sleep 2s | |
echo "Restarting internet" | |
nmcli networking on | |
sleep 10s | |
echo "Done" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment