Skip to content

Instantly share code, notes, and snippets.

@migrs
Created September 23, 2010 00:19
Show Gist options
  • Select an option

  • Save migrs/592840 to your computer and use it in GitHub Desktop.

Select an option

Save migrs/592840 to your computer and use it in GitHub Desktop.

Revisions

  1. migrs renamed this gist Dec 17, 2011. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. migrs revised this gist Sep 23, 2010. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,8 @@
    # Should-Stop: $named $time
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start and stop the dropbox daemon
    # Description: Dropbox daemon for debian/ubuntu
    # Short-Description: Start and stop the dropbox daemon for debian/ubuntu
    # Description: Dropbox daemon for linux
    ### END INIT INFO

    DROPBOX_USERS="user1 user2"
  3. migrs revised this gist Sep 23, 2010. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,16 @@
    # dropbox service
    # /etc/init.d/dropbox
    ### BEGIN INIT INFO
    # Provides: dropbox
    # Required-Start: $network $syslog $remote_fs
    # Required-Stop: $network $syslog $remote_fs
    # Should-Start: $named $time
    # Should-Stop: $named $time
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start and stop the dropbox daemon
    # Description: Dropbox daemon for debian/ubuntu
    ### END INIT INFO

    DROPBOX_USERS="user1 user2"
    start() {
    echo "Starting dropbox..."
  4. migrs revised this gist Sep 23, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ stop() {

    status() {
    for dbuser in $DROPBOX_USERS; do
    dbpid=`pgrep -u $dbuser dropboxd`
    dbpid=`pgrep -u $dbuser dropbox`
    if [ -z $dbpid ] ; then
    echo "dropboxd for USER $dbuser: not running."
    else
  5. migrs created this gist Sep 23, 2010.
    53 changes: 53 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    # dropbox service
    DROPBOX_USERS="user1 user2"
    start() {
    echo "Starting dropbox..."
    for dbuser in $DROPBOX_USERS; do
    start-stop-daemon -b -o -c $dbuser -S -x /home/$dbuser/.dropbox-dist/dropboxd
    done
    }

    stop() {
    echo "Stopping dropbox..."
    for dbuser in $DROPBOX_USERS; do
    start-stop-daemon -o -c $dbuser -K -x /home/$dbuser/.dropbox-dist/dropboxd
    done
    }

    status() {
    for dbuser in $DROPBOX_USERS; do
    dbpid=`pgrep -u $dbuser dropboxd`
    if [ -z $dbpid ] ; then
    echo "dropboxd for USER $dbuser: not running."
    else
    echo "dropboxd for USER $dbuser: running."
    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