how to write a simple bash command

I have a mac mini that has some software that is supposed to start at bootup, but does not always do so. In order to get the software running I need to open a terminal window and type some commands. Is it possible to just write a text file and turn it into a .command file that will not require me to write it out every time.


Here is exactly what I have to write in Terminal to get the program running again.


sudo su

filler14

ignition stop

ignition start

exit

exit


Typing sudo su asks for the password which is filler14. After entering it I type ignition stop and it takes a second and it responds that it stopped. I type ignition start and it takes about 3 seconds and responds that it is running. I type exit to get out of sudo su and then exit again and it says operation complete, and then I close terminal.


Is there a way to automate this?


Thanks,

Michael

Mac mini, Mac OS X (10.6.8)

Posted on Sep 12, 2014 3:56 PM

Reply
4 replies

Sep 12, 2014 5:41 PM in response to J.Morris

I added that to a text file and when executing it asks for the password to the machine. I'm not sure if it is asking just to run it, or if it is asking because the first line is sudo su and it is waiting for me to enter the password which is the second line.


how do I get it to run without any additional typing? It is on a touch screen that does not have a keyboard that is easily accessible.

Sep 15, 2014 6:26 PM in response to palmer_md

You need to create a launchd plist for it and put it in the /Library/LaunchDaemons folder. It will run as root on startup.

There are several tutorials all over the web, or you can use Lingon X ($10 probably is too steep for what you want--and likely isn't needed). The App Store version is cheaper, but cannot save directly to the /Library/LaunchDaemons folder due to App Store limitations. However, Peter Borg (developer) notes that you can just create one for your user, then move it to the Library/LaunchDaemons folder yourself.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to write a simple bash command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.