I'm unfamiliar with how this works with OSX. I just want a script to run whenever the OS loads up. Simple script to restart my servers via python. There's about 4 of them. So how do I run commands like the following at startup?
cd Applications/MyServer
python myserver.py
cd Applications/MyOtherServer
python myotherserver.py
and so on? I don't know where to place the script, or what type of file to save it in :/
UPDATE: ok i figured out that its just a matter of dumping that into a text file with an extension of .sh. Then running the sh myScript.sh command. But I'm still hunting for an answer how to get this to run at startup.
UPDATE: here's my script to start my servers. I'm still looking for a way to get it into startup. had to do them in separate windows as the application will then run in this window.
# Start up Server 1
osascript -e 'tell app "Terminal"
do script "python /applications/Server1/server1.py"
end tell'
# Start up Server 2
osascript -e 'tell app "Terminal"
do script "python /applications/server2/server2.py"
end tell'
# Start up Server 3
osascript -e 'tell app "Terminal"
do script "python /applications/server3/server3.py"
end tell'