Created
May 29, 2016 06:32
-
-
Save r-k-b/e35f90d09dc998a74f6fbd2ce6d016b7 to your computer and use it in GitHub Desktop.
Toggle the default route to be through a particular IP. Quickly switches between active ADSL & 4G connections with minimal disruption.
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 | |
if ip route list | grep 'default via 192.168.1.68' 1>/dev/null | |
then | |
ip route del default via 192.168.1.68 && | |
echo Removed adsl default route. | |
else | |
ip route add default via 192.168.1.68 && | |
echo Added adsl default route. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment