Skip to content

Instantly share code, notes, and snippets.

@SimonGreenhill
Created June 25, 2012 23:47
Show Gist options
  • Save SimonGreenhill/2992149 to your computer and use it in GitHub Desktop.
Save SimonGreenhill/2992149 to your computer and use it in GitHub Desktop.
Shell script to start and stop crashplan
#!/bin/sh
USER=~/Library/LaunchAgents/com.crashplan.engine.plist
SYSTEM=/Library/LaunchDaemons/com.crashplan.engine.plist
if [ -f $SYSTEM ]
then
PLIST=$SYSTEM
elif [ -f $USER ]
then
PLIST=$USER
else
echo "Unable to find plist file in /Library/LaunchDaemons/ or ~/Library/LaunchAgents/"
echo "Did you install crashplan in some other way?"
exit 1
fi
# see how we were called.
case "$1" in
start)
echo -n "Starting crashplan: "
launchctl load $PLIST
echo
;;
stop)
echo -n "Shutting down crashplan: "
launchctl unload $PLIST
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment