Skip to content

Instantly share code, notes, and snippets.

@michael-nischt
Last active August 29, 2015 13:57
Show Gist options
  • Save michael-nischt/9749038 to your computer and use it in GitHub Desktop.
Save michael-nischt/9749038 to your computer and use it in GitHub Desktop.
server side dropbox
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropbod
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Dropbox Service
### END INIT INFO
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"
DAEMON=/usr/bin/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $DAEMON start
done
}
stop() {
echo "Stopping dropbox..."
for dbuser in $DROPBOX_USERS; do
start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $DAEMON stop
done
}
status() {
for dbuser in $DROPBOX_USERS; do
dbpid=`pgrep -u $dbuser dropbox`
if [ -z $dbpid ] ; then
echo "dropboxd for USER $dbuser: not running."
else
echo "dropboxd for USER $dbuser: running (pid $dbpid)"
fi
done
}
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
@michael-nischt
Copy link
Author

INSTALL

save as '/etc/init.d/dropbox'

chmod +x /etc/init.d/dropbox
update-rc.d dropbox defaults

NOTES

Inspired by:
http://ubuntuservergui.com/ubuntu-server-guide/install-dropbox-ubuntu-server

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