How to create startup script on Debian



Today I have a problem that I have to add routing to my debian test box every time that server start so I googling and found this

This method I think it is only work on Debian based distro and I not sure about Redhat based distro

First create file in /etc/init.d/. For me I create route file for routing script.

vi /etc/init.d/route

Then put your Bash shell script. This example is my routing script

/sbin/route add -net netmask gw
/sbin/route add -net netmask gw

Run these last commands to run the script every time server start.

chmod +x /etc/init.d/route
update-rc.d route defaults

route is the name of your bash shell script