Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created February 18, 2022 02:10
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 oxagast/a53ccd74c01b0708b0fa5d580edda432 to your computer and use it in GitHub Desktop.
Save oxagast/a53ccd74c01b0708b0fa5d580edda432 to your computer and use it in GitHub Desktop.
ping www.google.com -c 1 -W 2
if [ $? -ne 0 ]; then
for INF in {0 .. 5}; do
systemctl stop openvpn@client
systemctl start openvpn@client;
sleep 1;
echo 'nameserver 8.8.8.8' > /etc/resolv.conf;
echo 'nameserver 8.8.4.4' > /etc/resolv.conf;
ping www.google.com -c 1 -W 2
if [ $? -eq 0 ]; then
sleep 3;
ip addr show dev wlp1s0;
ip addr show dev tun0;
echo "Interface up!";
exit;
else
echo "Interface net yet up.";
fi;
done;
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment