Interesting question. Thanks for pointing out files in /etc/rc0.d
you learn something new every day!
Create directory to drop your scripts into
First you need to create a directory of scripts you want automatically run at startup. I would suggest creating it within /usr/local/bin
but it can be anywhere:
sudo mkdir /usr/local/bin/startup-scripts
Modify rc.local to run all your scripts
Then type gksu gedit /etc/rc.local
to edit the startup script that has sudo
powers.
Before the last line that says exit 0
copy and paste these lines:
for SCRIPT in /usr/local/bin/startup-scripts/*
do
sudo chmod +x $SCRIPT
$SCRIPT
done
Optionally, for every script in the startup-scripts
directory, I would put in something like:
echo "running script xyz within /usr/local/bin/startup-scripts"
as this message will appear in /var/log/syslog
file and document your system setup.