running a simple shell script on startup in Yosemite Regarding stackexchange  post how to get shell scripts to run at startup on Yosemite

The offering here is interesting but all I want to do is set the ip address of one of the ethernet interfaces, en0 with ifconfig. I don't want to launch a deamon.

the command to run is just:

ifconfig en0  inet 192.168.1.23 netmask 255.255.255.0 


Of course the interface drivers have to be launched and the interfaces available for configuration. 
This has to be run by root, other wise it has to be prefaced with sudo, which
has to have the credentials provided.

I have the root account activated on this system and am comfortable with and know most of the hazards.

But I don't want to do this manually every time the machine is booted or restarted.

Perhaps someone from Apple has a reference to a patch or info on why the
network preference operations for manual configuration of interfaces will not set them on mine. 

I have been buying and using Macs since the late 1990's. This is one of only two out of nearly a dozen Macs I have owned that is not newly purchased from
a reputable dealer.

Apache server will also not launch with the web sharing option.

Perhaps the machine with the installation is too old? It is

Note: I BOUGHT THIS MACHINE USED FOR CASH
 Model Name:    MacBook Pro
 Model Identifier:  MacBookPro5,1
 Processor Name:    Intel Core 2 Duo
 Processor Speed:   2.4 GHz
 Number of Processors:  1
 Total Number of Cores: 2
 L2 Cache:  3 MB
 Memory:    4 GB
 Bus Speed: 1.07 GHz
 Boot ROM Version:  MBP51.007E.B06
 SMC Version (system):  1.33f8
 &lt;sn deleted for this post&gt;
  Hardware UUID:    63410FEB-9CFF-5C8C-A692-8733BBEE36C5
 Sudden Motion Sensor:
 State: Enabled


This does not tell me its actuall manufacture date.

Thank you for time and attention

Jeff
You could save your script whatever you want and call it from a .plist file saved on /Library/LaunchAgents/ to be launched at startup.

Let me explain how to do it with an example.


Create you script and save it on /Users/username/setip.sh.
Create a new file called com.username.setip.plist in /Library/LaunchAgents/. This file must have the following format:


&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.username.setip&lt;/string&gt;

  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;/Users/username/setip.sh&lt;/string&gt;
  &lt;/array&gt;

  &lt;key&gt;Nice&lt;/key&gt;
  &lt;integer&gt;1&lt;/integer&gt;

  &lt;key&gt;StartInterval&lt;/key&gt;
  &lt;integer&gt;60&lt;/integer&gt;

  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;

  &lt;key&gt;StandardErrorPath&lt;/key&gt;
  &lt;string&gt;/tmp/com.username.setip.err&lt;/string&gt;

  &lt;key&gt;StandardOutPath&lt;/key&gt;
  &lt;string&gt;/tmp/com.username.setip.out&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;


The file is pretty self-explanatory. It will launch the command /Users/username/setip.sh every 60 seconds, will be launched at load, will save errors on /tmp/com.username.setip.err and logs on /tmp/com.username.setip.out.

Restart, and the script will be executed.