Last active
December 18, 2015 23:49
-
-
Save h3/5864091 to your computer and use it in GitHub Desktop.
Try networking configuration and set a restore time (tested on Ubuntu)
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/sh | |
RESTART="/etc/init.d/networking restart" | |
FILEPATH="/etc/network/interfaces" | |
BACKUPPATH="$FILEPATH.BAK" | |
RESET_TIME="now + ${1:-5min}" | |
sudo cp -fp $FILEPATH $BACKUPPATH && \ | |
sudoedit $FILEPATH && \ | |
sudo bash -c "echo 'cp -fp $BACKUPPATH $FILEPATH && $RESTART' | at $RESET_TIME" && \ | |
sudo $RESTART |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
System integration: