Created
August 11, 2016 14:22
-
-
Save stikmanw/7e64a21c618accc1a9f6123ec5ddaf7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is for stopping crashplan from eating all your CPU like it does on my machine.