Skip to content

Instantly share code, notes, and snippets.

@jeremy-w
Created December 7, 2012 21:59
Show Gist options
  • Save jeremy-w/4236857 to your computer and use it in GitHub Desktop.
Save jeremy-w/4236857 to your computer and use it in GitHub Desktop.
Launchd plist to run camper_van and accompanying install script.
#!/bin/sh
gem install camper_van
CAMPER_VAN="`which camper_van`"
if test \! -x "$CAMPER_VAN"; then
echo >&2 "error: camper_van not found on path - unable to install plist"
exit 1
fi
# Substitute in the fixed path to use to launch camper_van.
sed -i '' -e "/CAMPER_VAN_BIN_PATH/s##$CAMPER_VAN#" local.camper_van.plist
# Copy the plist to /Library/LaunchDaemons and fire 'er up.
sudo install -d /Library/LaunchDaemons
sudo cp local.camper_van.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/local.camper_van.plist
# Now configure your IRC client to connect to localhost:6667 with password
# of orgname:apikey. Orgname is what you visit to view Campfire on the web,
# http://orgname.campfirenow.com. Your API key can be found as part of
# your Campfire user profile on the Campfire website.
<?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>Disabled</key>
<false/>
<key>Label</key>
<string>local.camper_van</string>
<key>Program</key>
<string>CAMPER_VAN_BIN_PATH</string>
<key>Sockets</key>
<dict>
<key>irc-bridge</key>
<dict>
<key>SockServiceName</key>
<string>6667</string>
</dict>
</dict>
</dict>
</plist>
@wallace
Copy link

wallace commented Apr 27, 2013

fyi, i had serious issues getting this to work with rvm. switching to rbenv allowed me to use this method as rbenv uses shims to replace the global ruby installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment