Skip to content

Instantly share code, notes, and snippets.

@maximzasorin
Created August 5, 2015 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximzasorin/63d91a8328eeff0e1421 to your computer and use it in GitHub Desktop.
Save maximzasorin/63d91a8328eeff0e1421 to your computer and use it in GitHub Desktop.
Remove default route, wait for Ctrl+C and restore it
#!/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