Last active
December 21, 2015 20:18
-
-
Save lamvak/6359805 to your computer and use it in GitHub Desktop.
short bash script for reconnecting aero2 connection using network manager with modem manager
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 | |
while true; | |
do | |
sleep 30s; | |
ping -c 1 8.8.8.8 > /dev/null 2>&1; | |
if [[ $? != 0 ]]; | |
then | |
echo "connection dropped; reconnecting now"; | |
date; | |
killall -HUP modem-manager && sleep 30s && nmcli con up uuid <<PLACE your aero2 connection uuid here>> && sleep 120s; | |
fi; | |
done | |
# drop the << and >> from above | |
# you can get the uuid for the aero2 connection running | |
# nmcli con |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment