As you are using Raspbian Wheezy I am assuming you are using the default init system provided by systen V init
rather than the systemd
that is used in Jessie and most other GNU/Linux distributions these days.
That being the case you will want to check out putting the name of your script startup.sh &
at the end of /etc/rc.local
.
This file is executed during startup (make sure your file is owned by and in group root
{sudo chown root:root startup.sh
} and marked as executable {sudo chmod ug+x startup.sh
}), is given with a full path name if not in the /etc
directory and, to ensure it is run as a shell script, ensure the first line starts with #!/bin/sh
and to ensure it runs in the background and the system continues to boot after running it if it does NOT exit straight away you must do something like using the &
backgrounding option on the end of that line in the /etc/local
file.
That last bit is important as the system will wait for your script to finish before continuing - which will make it impossible to log in normally otherwise!
/etc/rc.local
. – nsilent22 Jan 24 '16 at 16:01.bashrc
is the thing to use for this, but when I find out I will hunt down those responsible and destroy them forever. – goldilocks Jan 24 '16 at 16:14~/.bashrc
is run for the user as an initialization file for interactive logins unless overridden by--rcfile
(to run a different file) or--noprofile
or--norc
options to thebash
shell - which ignores it. This can have unintentional side effects...! – SlySven Jan 24 '16 at 16:23