How to run a one-liner shell command using launchd? Below is an example of what I'm trying to do:

    &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;fooLabel&lt;/string&gt;
        &lt;key&gt;Something&lt;/key&gt;
        &lt;string&gt;/bin/bash foo -arg 1 -arg 2 &amp;&lt;/string&gt;
&lt;/dict&gt; 
&lt;/plist&gt;


The plist was added to /Library/LaunchDaemons so it should run at boot for all users, right? The appropriate file permissions were set.

The script needs to run as a background process and also requires network connectivity. How can I make sure the plist doesnt launch until internet access is established?
You want to include this check for network state:

&lt;dict&gt;
  &lt;key&gt;NetworkState&lt;/key&gt;
  &lt;true/&gt;
&lt;/dict&gt;


Also - you probably want to pass in your program args correctly:

&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;/usr/local/bin/binaryname&lt;/string&gt;
    &lt;string&gt;arg1&lt;/string&gt;
    &lt;string&gt;arg2&lt;/string&gt;
&lt;/array&gt;