Skip to content

Instantly share code, notes, and snippets.

@beothorn
Created September 10, 2020 20:27
Show Gist options
  • Save beothorn/aa3c5311674303925abc52d3ce203058 to your computer and use it in GitHub Desktop.
Save beothorn/aa3c5311674303925abc52d3ce203058 to your computer and use it in GitHub Desktop.
#!/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