Skip to content

Instantly share code, notes, and snippets.

@yaodong
Created January 10, 2015 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaodong/b7a6b3e61753cfc55f20 to your computer and use it in GitHub Desktop.
Save yaodong/b7a6b3e61753cfc55f20 to your computer and use it in GitHub Desktop.
script for start, stop and restart dropbox
#!/usr/bin/env bash
case $1 in
start)
open -a dropbox;
;;
stop)
osascript -e 'tell application "dropbox" to quit'
;;
restart)
$0 stop
$0 start
;;
diff)
find ~/Dropbox/ -path "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -print
;;
clean)
find ~/Dropbox/ -path "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -exec rm -f {} \;
;;
*)
echo "Usage: dropbox {start|stop|restart|diff|clean}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment