Last active
March 25, 2021 14:16
-
-
Save shrekuu/7a1c166c335fc5a5a90f5f222cfd2bad to your computer and use it in GitHub Desktop.
ensure-wifi-connection.sh
This file contains hidden or 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 | |
if ethtool wlp2s0 | grep -q "Link detected: no"; then | |
echo connecting | |
echo $(nmcli d connect wlp2s0) | |
else | |
echo connected | |
fi |
This file contains hidden or 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 | |
nmcli d connect wlp2s0 | |
# wlp2s0 is the name of my wifi device |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment