Skip to content

Instantly share code, notes, and snippets.

@Phlogi
Last active May 23, 2016 06:30
Show Gist options
  • Save Phlogi/8654e353786ed1cf0858 to your computer and use it in GitHub Desktop.
Save Phlogi/8654e353786ed1cf0858 to your computer and use it in GitHub Desktop.
crashplan remote script for OSX
#!/bin/sh
# Adapt the two first variables to your environment
# Requirements:
# -the user below can connect to the IP without password (copy ssh key)
# changes on server: ...share/crashplan/conf/my.service.xml:
# <serviceUIConfig>
# <serviceHost>0.0.0.0</serviceHost>
#
CPSSHUSER='root'
CPHOST='192.168.1.214'
cd /Library/Application\ Support/CrashPlan/
rm -f .ui_info
scp $CPSSHUSER@$CPHOST:/var/lib/crashplan/.ui_info ./.ui_info
#CPPORT=`cat .ui_info | cut -d ',' -f 1`
echo "current port: $CPPORT on $CPHOST"
WRONGIP=`cat .ui_info | cut -d ',' -f 3`
#sed -i .ui_info "s/$CPPORT/4200/g" .ui_info
sed -i .ui_info "s/$WRONGIP/$CPHOST/g" .ui_info
#ssh -f -L 4200:127.0.0.1:$CPPORT $CPSSHUSER@$CPHOST -N
open -W -a CrashPlan.app
#kill $(ps -A | grep 'ssh -f -L 4200:127.0.0.1' | grep -v grep | awk '{print $1}')
#rm -f .ui_info
#mv .ui_info_bak .ui_info
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment