Run script on startup, halt, reboot

Tag(s):

chmod +x yourscript.sh
cp yourscript.sh /etc/init.d/
cd /etc/init.d/
update-rc.d yourscript.sh start 20 0 6 .
 
# Runlevel
#  0=halt
#  6=reboot

Ignore message insserv: warning: script 'yourscript.sh' missing LSB tags and overrides. This warning appears because yourscript.sh format doesn't conform to LSB init script.