Created
September 19, 2016 01:55
-
-
Save Fusion/af03c66afb8c748bd28de89dd521d05d to your computer and use it in GitHub Desktop.
Manage multiple headless CrashPlan servers
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
#!/bin/bash | |
function syntax() { | |
echo "Syntax: $0 localserver1|remoteserver2" | |
exit 1 | |
} | |
if [ -z "$1" ]; then | |
syntax | |
fi | |
case "$1" in | |
"localserver1") | |
echo -n "4243,localserver1-token-from-own_ui_info,127.0.0.1" > /Library/Application\ Support/CrashPlan/.ui_info | |
/Applications/CrashPlan.app/Contents/MacOS/CrashPlan | |
;; | |
"remoteserver2") | |
echo -n "4200,remoteserver2-token-from-own_ui_info,127.0.0.1" > /Library/Application\ Support/CrashPlan/.ui_info | |
ssh -M -S cp-socket -fnNT -L 4200:localhost:4243 user@remoteserver2 | |
sleep 5 | |
/Applications/CrashPlan.app/Contents/MacOS/CrashPlan | |
ssh -S cp-socket -O exit user@remoteserver2 | |
;; | |
*) | |
syntax | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment