Posted on 2006-06-12
Ok ... Here is the scenario.
In cisco devices, using the IOS, it is possible to setup the device to reboot after a specified time (usually minutes). I would like to implement the same feature in Linux. I know what command to use. But I would like to run a script exactly before the computer restarts.
Basically, I would like to play with iptables. However, I am doing it remotely. So I am running the risk of locking down the remote access to the box. Thus, it would be nice to have this feature implemented ...
In practice it would work like that:
1. Save current iptables config
2. Set the feature ON (reload after x minutes)
3. Make my changes; play with the config; ...
4. If the box becomes inaccessible, it would restart after x minutes. Yet, on restart, it would copy the old iptables config so that the box become available after restart
I believe this is possible ... at least, everyone says Linux is so flexible ... I'm a rookie when it comes to Linux. However, you can use any technical details you think apropriate ... check my profile if in doubt of what I can do ;)
I am using CentOS with GUI loaded. But I am starting to enjoy the command line. So, if you could provide two separate solutins, even better.