Skip to content

Instantly share code, notes, and snippets.

@geta6
Created April 14, 2013 01:29
Show Gist options
  • Save geta6/5380950 to your computer and use it in GitHub Desktop.
Save geta6/5380950 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.nginx</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/nginxsudo</string>
<string>-g</string>
<string>daemon off;</string>
</array>
<key>WorkingDirectory</key>
<string>/usr/local</string>
</dict>
</plist>
#!/bin/sh
function on_die() {
sudo "`which nginx`" -s stop
exit 0
}
trap on_die TERM
sudo "`which nginx`" $@ &
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment