Copy your script to /etc/init.d folder.
update-rc.d ScriptName start ServiceNo. RunLevel .
If your script name whois.sh ,
update-rc.d whois.sh start 20 2 .
If you want the script to be run on boot time,
Specify the runlevel as 2
If you want the script to be run on reboot time,
Specify the runlevel as 6
If you want the script to be run on Shutdown time,
Specify the runlevel as 0
To Remove the Script from Run level ,
update-rc.d -f whois.sh remove
update-rc.d ScriptName start ServiceNo. RunLevel .
If your script name whois.sh ,
update-rc.d whois.sh start 20 2 .
If you want the script to be run on boot time,
Specify the runlevel as 2
If you want the script to be run on reboot time,
Specify the runlevel as 6
If you want the script to be run on Shutdown time,
Specify the runlevel as 0
To Remove the Script from Run level ,
update-rc.d -f whois.sh remove
No comments:
Post a Comment