[Ubuntu] Executing a script at startup and shutdown
To execute a script at startup of Ubuntu
Edit
/etc/rc.local and add your commands.
The script must always end with an un
exit 0
To execute a script at startup
Put your script in
/etc/rc0.d
and make it executable (sudo chmod +x myscript)
Note that : The scripts in this directory are executed in alphabetical order.
The name of your script must begin with
K99 to run at the right time.
To execute a script at shutdown
Put your script in
/etc/rc6.d
and make it executable (sudo chmod +x myscript)
Note that: The scripts in this directory are executed in alphabetical order.
The name of your script must begin with
K99 to run at the right time.