-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdropbox
49 lines (41 loc) · 828 Bytes
/
dropbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropboxd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Dropbox server
### END INIT INFO
set -e
DROPBOX_LOGIN=nicolargo
SYSTEM_LOGIN=nicolargo
test -x /home/$USERNAME/.dropbox-dist/dropboxd || exit 0
start() {
echo "Starting dropbox..."
start-stop-daemon -b -o -c $DROPBOX_LOGIN -S -x /home/$SYSTEM_LOGIN/.dropbox-dist/dropboxd
}
stop() {
echo "Stopping dropbox..."
start-stop-daemon -o -c $DROPBOX_LOGIN -K -x /home/$SYSTEM_LOGIN/.dropbox-dist/dropboxd
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload|force-reload)
stop
start
;;
restart)
stop
start
;;
*)
echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart}"
exit 1
esac
exit 0