updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / dropbox-daemon / dropboxd
blob2b6045dd605d946649c9273701db73250bc15fd1
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 . /etc/conf.d/dropboxd.conf
9 PID=`pidof -o %PPID $DROPBOX_PATH`
11 case "$1" in
12 start)
13 stat_busy "Starting Dropbox Service"
14 if [ $USER = 'yourusername' ]; then
15 echo "Please edit /etc/conf.d/dropboxd.conf before using this script."
16 stat_fail
17 else
18 LANG=$LOCALE
19 [ -z "$PID" ] && su -c "$DROPBOXD_PATH &" $USER
20 if [ $? -gt 0 ]; then
21 stat_fail
22 else
23 add_daemon dropboxd
24 stat_done
28 stop)
29 stat_busy "Stopping Dropbox Service"
30 [ ! -z "$PID" ] && kill $PID > /dev/null
31 if [ $? -gt 0 ]; then
32 stat_fail
33 else
34 rm_daemon dropboxd
35 stat_done
38 restart)
39 $0 stop
40 sleep 3
41 $0 start
44 echo "usage: $0 {start|stop|restart}"
46 esac
47 exit 0