Last active
November 27, 2016 05:06
-
-
Save ys-qb/994aa1b97ce3766712ec53df37fb2420 to your computer and use it in GitHub Desktop.
jetdrive
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
#!/bin/sh | |
if pgrep Dropbox > /dev/null; then | |
osascript -e 'tell application "Dropbox" to quit' | |
fi | |
diskutil unmountDisk /dev/disk2 > /dev/null 2>&1 |
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
#!/bin/sh | |
diskutil mount /dev/disk2s1 > /dev/null 2>&1 | |
if ! pgrep Dropbox > /dev/null; then | |
osascript -e 'tell application "Dropbox" to launch' | |
fi |
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
brew update && brew install sleepwatcher | |
#startup daemon | |
sudo ln -sfv /usr/local/opt/sleepwatcher/*.plist /Library/LaunchDaemons/ | |
launchctl load /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist | |
#change scripts executable | |
chmod a+x ~/.sleep ~/.wakeup | |
#backup | |
MOUNT_DIR=/Volumes/sd64 | |
rsync -av --delete ~/Dropbox $MOUNT_DIR/ | |
mv ~/Dropbox ~/Dropbox.org | |
ln -s $MOUNT_DIR/Dropbox ~/Dropbox | |
#make sure it's running | |
#ps -ef | grep sleepwatcher | |
# 501 20898 1 0 11:35AM ?? 0:01.16 /usr/local/sbin/sleepwatcher -V -s ~/.sleep -w ~/.wakeup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment