Created
March 29, 2014 20:46
-
-
Save shrop/9862648 to your computer and use it in GitHub Desktop.
CrashPlan Pause/Resume
This file contains 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
set isCrashPlanRunning to false | |
try | |
set pid to do shell script ¬ | |
"sudo launchctl list | grep com.crashplan.engine" user name "username" password ¬ | |
"password" with administrator privileges | |
set isCrashPlanRunning to true | |
end try | |
if isCrashPlanRunning then | |
log "CrashPlan is already running: " & pid | |
else | |
log "CrashPlan is not currently running…" | |
end if | |
if isCrashPlanRunning then | |
log "Stopping CrashPlan engine…" | |
do shell script ¬ | |
"launchctl unload -w /Library/LaunchDaemons/com.crashplan.engine.plist" user name "username" password ¬ | |
"password" with administrator privileges | |
else | |
log "Starting CrashPlan engine…" | |
tell application "CrashPlan menu bar" to activate | |
do shell script ¬ | |
"launchctl load -w /Library/LaunchDaemons/com.crashplan.engine.plist" user name "username" password ¬ | |
"password" with administrator privileges | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment