Created
August 20, 2024 14:33
-
-
Save IAmMoltony/b41e97b651930a84616b1f99cbfdf816 to your computer and use it in GitHub Desktop.
Script for auto reconnecting wifi
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
#!/usr/bin/env bash | |
network_name="wifi network name here" | |
notify-send "Autorecon started" | |
while true; do | |
if ! ping -c 2 google.com; then | |
notify-send "Network not networking, reconnect" | |
nmcli con up "$network_name" | |
sleep 10 | |
fi | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment