Skip to content

Instantly share code, notes, and snippets.

@lmammino
Last active May 10, 2016 12:41
Show Gist options
  • Save lmammino/8467336 to your computer and use it in GitHub Desktop.
Save lmammino/8467336 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 /dropbox/.dropbox-dist/dropbox
}
stop() {
echo "Stopping dropbox..."
start-stop-daemon -o -c dropbox -K -x /dropbox/.dropbox-dist/dropbox
}
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
@paulovieira
Copy link

Thanks! Note that name of the main script has changed from .dropbox-dist/dropbox to .dropbox-dist/dropboxd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment