Quote:
Originally Posted by ganeshp@moris.org
Hi All,
Is there a way to execute some command and then after the command completes automatically reboot the system and then after the system reboots execute another command ?
For example look at the sequence shown below
(1) Execute command-1
(2) After the command-1 in (1) is completed,reboot the system
(3) Execute command-2
(4) After execution of command-2 reboot the sytem
Is there a way i can automate this process so that i need not reboot the system manually
Thanks and Regards
Ganesh
|
1. you write a script: shutdown -r now.
2. command1 here.
3. shutdown -r now
4. command2 here.
5. make it executable chmod 777 [name of file].
6. link it in rc3.d, rc4.d, rc5.d by typing
ln -s [your script] /etc/rc3.d/S97myscript
ln -s [your script] /etc/rc4.d/S97myscript
ln -s [your script] /etc/rc5.d/S97myscript
S of 97 meaning "Start" ...K is "Kill"...make sure you choose different number after Snn.
7. if you finished... delete the link by rm command.