how to get shell scripts to run at startup on Yosemite
One way of doing it would be assigning the script a launchd service:

Create the shell script as usual. Then you can make a launchd service to run it at startup. Those are located at /Library/LaunchDaemons. These are in the XML property list format. Create another and populate it with something like this:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;com.example.app&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
            &lt;string&gt;/bin/sh&lt;/string&gt;
            &lt;string&gt;/path/to/script&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;RunAtLoad&lt;/key&gt;
        &lt;true/&gt;
        &lt;key&gt;KeepAlive&lt;/key&gt;
        &lt;false/&gt;
    &lt;/dict&gt;
&lt;/plist&gt;


Change com.example.app, /bin/sh and /path/to/script as required.

The script will then run while the system is booting. If it runs too early, you can either write the script to try and do what it needs to do until it succeeds, or have it exit with a non-zero error code and add this to the property list before the &lt;/dict&gt; line:

&lt;key&gt;KeepAlive&lt;/key&gt;
&lt;dict&gt;
     &lt;key&gt;SuccessfulExit&lt;/key&gt;
     &lt;false/&gt;
&lt;/dict&gt;


For more on OS X launch daemons and services, I suggest looking here for a nice quick-reference on making them, or here for a more comprehensive reference on what launchd can do.