Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### BEGIN INIT INFO
- # Provides: dropbox
- # Required-Start: $local_fs $network
- # Required-Stop:
- # Default-Start: 3 5
- # Default-Stop: 0 1 2 6
- # Short-Description: Starts dropbox daemon for user
- # Description: Starts dropbox daemon
- ### END INIT INFO
- RUN_AS_USER=user
- DROPBOX_HOME=/home/user/.dropbox-dist
- start() {
- unset DISPLAY
- echo "Starting dropbox: "
- if [ "x$USER" != "x$RUN_AS_USER" ]; then
- su - $RUN_AS_USER -c "$DROPBOX_HOME/dropboxd & >> $DROPBOX_HOME/log.log 2>&1"
- else
- $DROPBOX_HOME/dropboxd & >> $DROPBOX_HOME/log.log 2>&1
- fi
- echo "Done."
- }
- stop() {
- echo "Shutting down dropbox: "
- if [ "x$USER" != "x$RUN_AS_USER" ]; then
- su - $RUN_AS_USER -c "killall -u $RUN_AS_USER dropbox"
- else
- killall -u $RUN_AS_USER dropbox
- fi
- echo "Done."
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement