Advertisement
Guest User

Untitled

a guest
Jan 16th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.93 KB | None | 0 0
  1. ### BEGIN INIT INFO
  2. # Provides: dropbox
  3. # Required-Start: $local_fs $network
  4. # Required-Stop:
  5. # Default-Start: 3 5
  6. # Default-Stop: 0 1 2 6
  7. # Short-Description: Starts dropbox daemon for user
  8. # Description: Starts dropbox daemon
  9. ### END INIT INFO
  10. RUN_AS_USER=user
  11. DROPBOX_HOME=/home/user/.dropbox-dist
  12. start() {
  13.   unset DISPLAY
  14.   echo "Starting dropbox: "
  15.   if [ "x$USER" != "x$RUN_AS_USER" ]; then
  16.     su - $RUN_AS_USER -c "$DROPBOX_HOME/dropboxd & >> $DROPBOX_HOME/log.log 2>&1"
  17.   else
  18.     $DROPBOX_HOME/dropboxd & >> $DROPBOX_HOME/log.log 2>&1
  19.   fi
  20.   echo "Done."
  21. }
  22. stop() {
  23.   echo "Shutting down dropbox: "
  24.   if [ "x$USER" != "x$RUN_AS_USER" ]; then
  25.     su - $RUN_AS_USER -c "killall -u $RUN_AS_USER dropbox"
  26.   else
  27.     killall -u $RUN_AS_USER dropbox
  28.   fi
  29.   echo "Done."
  30. }
  31. case "$1" in
  32.  start)
  33.  start
  34.  ;;
  35.  stop)
  36.  stop
  37.  ;;
  38.  restart)
  39.  stop
  40.  start
  41.  ;;
  42.  *)
  43.  echo "Usage: $0 {start|stop|restart}"
  44. esac
  45. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement