Skip to content

Instantly share code, notes, and snippets.

@lamvak
Last active December 21, 2015 20:18
Show Gist options
  • Save lamvak/6359805 to your computer and use it in GitHub Desktop.
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
#!/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