In order to add a program or script to the link to the autoloader, you need to do the following:
Create a file in /etc/init.d/
sudo nano /etc/init.d/myscript.sh
Making the /etc/init.d/local script file executable:
sudo chmod +x /etc/init.d/myscript.sh
Add the /etc/init.d/myscript.sh script to the autoloader
sudo update-rc.d myscript.sh defaults 80
That’s it. You can now add commands to our script that must be executed when the system starts up.
P.S. Removal of the script from auto-loading:
sudo update-rc.d -f /etc/init.d/myscript.sh remove