Skip to content

Instantly share code, notes, and snippets.

@hydra35
Created July 29, 2013 09:00
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 hydra35/6103085 to your computer and use it in GitHub Desktop.
Save hydra35/6103085 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "./enable_alternative_gw.sh original_gw alternative_gw"
exit 1
fi
original_gw=$1
gw=$2
sed -i "s/gateway $original_gw/gateway $gw/" /etc/network/interfaces
/etc/init.d/networking restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment