Perhaps some context would be helpful.
This is on a box which will be deployed remotely, and only accessed over SSH (or possibly telnet). All users except root will have their 'shell' set to run my perl script. Among other things, it will have some system admin capability. One of those capabilities is to change the box's IP address. It will have the option of being DHCP or static. Obviously, if they change the IP address, they will lose connectivity to the box as soon as it is applied. Unfortunately, restarting networking will drop the ssh session, which will stop the script, so networking never starts again. Therefore, I am happy to have it change the bootup configuration on the network, and have the changes applied at reboot.
I don't particularly wish to give anyone else write access to /etc/network/interfaces, and I was wondering if there was any way to do the job from within perl, rather than messing about with system files myself.
Gah! Don't do it as a reboot. You can nohup this, so that when the ssh connection is dropped, the script continues. Please don't bounce a unix server for something as trivial as a changing the IP address.
--
I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.