Created
February 18, 2022 02:10
-
-
Save oxagast/a53ccd74c01b0708b0fa5d580edda432 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
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