Skip to content

Instantly share code, notes, and snippets.

@paulovieira
Forked from lmammino/dropbox
Last active January 14, 2016 12:15
Show Gist options
  • Save paulovieira/89237699cbb883aeb213 to your computer and use it in GitHub Desktop.
Save paulovieira/89237699cbb883aeb213 to your computer and use it in GitHub Desktop.
Run dropbox CLI as service
#/etc/init.d/dropbox
start() {
echo "Starting dropbox..."
start-stop-daemon -b -o -c dropbox -S -x /home/dropbox/.dropbox-dist/dropboxd
}
stop() {
echo "Stopping dropbox..."
start-stop-daemon -o -c dropbox -K -x /home/dropbox/.dropbox-dist/dropboxd
}
status() {
dbpid=$(pgrep -u root dropbox)
if [ -z $dbpid ] ; then
echo "dropbox not running."
else
echo "dropbox running."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
stop
start
;;
status)
status
;;
*)
echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment