-
-
Save duyet/4c6372e2be27af443e3c to your computer and use it in GitHub Desktop.
Run dropbox CLI as service
This file contains 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
#/etc/init.d/dropbox | |
start() { | |
echo "Starting dropbox..." | |
start-stop-daemon -b -o -c dropbox -S -x /dropbox/.dropbox-dist/dropboxd | |
} | |
stop() { | |
echo "Stopping dropbox..." | |
start-stop-daemon -o -c dropbox -K -x /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