Skip to content

Instantly share code, notes, and snippets.

@StephenKing
Last active November 23, 2016 07:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save StephenKing/83fedc56137f5640de929b4430f1b653 to your computer and use it in GitHub Desktop.
Save StephenKing/83fedc56137f5640de929b4430f1b653 to your computer and use it in GitHub Desktop.
Network config reset
#!/bin/sh
##########################################
# Make sure that $FILE.$BACKUP_EXT exists!
# i.e. /etc/network/interfaces.bak
##########################################
FILE=/etc/network/interfaces
BACKUP_EXT=bak
echo "mv $FILE $FILE.reverted; cp $FILE.$BACKUP_EXT $FILE; service networking restart" | at now + 1 min
echo "reboot" | at now + 5 min
echo "Following jobs are scheduled:"
atq
echo
echo "Remove jobs using 'atrm <num>' to unschedule"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment