Created
August 5, 2015 19:45
-
-
Save maximzasorin/63d91a8328eeff0e1421 to your computer and use it in GitHub Desktop.
Remove default route, wait for Ctrl+C and restore it
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 | |
ip route del default | |
trap ctrl_c INT | |
function ctrl_c() { | |
ip route add default via 192.168.1.1 | |
exit | |
} | |
while true | |
do | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment