Ever had to change the IP on a server that's without any local supervision, behind who knows how many firewalls, in another country, with only SSH accesss sticking out of it? Wouldn't it be nice if there was a function similar to the Displays preference pane, in which, if the settings turn out to be incorrect, it automatically reverts to the previous working setup? Well, here's one.
Before any critical conf change, I just re-define the current config into an at command:
$ sudo at now + 15 minute
$ changeip - newip oldip newhost oldhost
$ networksetup -setmanual networkport oldipĀ oldnetmask oldrouter
$ Ctrl -D
Then, make your changes. If all does work out, don't forget to disable the safety harness:
$ sudo at -l
$ sudo at -r jobnumber
I used an IP change as an example here, but I'm sure you can think of other scenarios with potentially tragic consequences.
Read more›
Recent Comments