Skip to content

Instantly share code, notes, and snippets.

@stikmanw
Created August 11, 2016 14:22
Show Gist options
  • Save stikmanw/7e64a21c618accc1a9f6123ec5ddaf7d to your computer and use it in GitHub Desktop.
Save stikmanw/7e64a21c618accc1a9f6123ec5ddaf7d to your computer and use it in GitHub Desktop.
CMD=$1;
if [[ `id -u` = 0 ]]; then
echo "You mustn't be root when executing this script";
exit;
fi
function usage {
echo "Usage: $(basename $0) COMMAND
COMMANDS:
stop Stop CrashPlan
start Start CrashPlan Service
restart Stop CrashPlan, then start again.
status Is CrashPlan running?
";
exit 1;
}
function start () {
sudo launchctl load /Library/LaunchDaemons/com.crashplan.engine.plist;
launchctl load /Library/LaunchDaemons/com.crashplan.engine.plist;
sleep 1;
status;
}
function stop () {
sudo launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist;
launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist;
sudo killall CrashPlanService &>/dev/null;
sleep 1;
status;
}
function status () {
ps auwwx | egrep "CrashPlanService" | grep -vq egrep;
if [[ 0 == $? ]]; then
echo "Crashplan is running.";
else
echo "Crashplan is stopped";
fi
}
case $CMD in
(start) start;;
(stop) stop;;
(restart) stop && start;;
(status) status;;
(*) usage;;
esac
exit 0;
@stikmanw
Copy link
Author

This is for stopping crashplan from eating all your CPU like it does on my machine.

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