Skip to content

Instantly share code, notes, and snippets.

@hydra35
Created July 29, 2013 09:00
Show Gist options
  • 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