Created
December 24, 2019 09:49
-
-
Save shrekuu/d254a3358960d0c61bb9ee1f50c6f131 to your computer and use it in GitHub Desktop.
reconnect to wifi when wifi is down, crontab job
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
#!/bin/bash | |
# ref: https://askubuntu.com/a/421751/596437 | |
wlan=`/sbin/ifconfig wlp2s0 | grep inet\ addr | wc -l` | |
if [ $wlan -eq 0 ]; then | |
/sbin/ifconfig wlp2s0 down && /sbin/ifconfig wlp2s0 up | |
else | |
echo "interface is up" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment