Assorted away-tpope updates
[tpope-extra.git] / bluetooth / init.d / obexd
1 #! /bin/sh
2 # $Id$
3 # -*- sh -*- vim: ft=sh sw=4 sts=4
4 #
5 # /etc/init.d/obexd     Used to launch Tim Pope's obexserver wrapper
6
7 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
8 DAEMON=/usr/local/sbin/obexd
9 NAME=obexd
10 DESC="obexserver daemon"
11
12 test -x $DAEMON || exit 0
13
14 set -e
15
16 case "$1" in
17   start)
18         echo -n "Starting $DESC$NAME"
19         start-stop-daemon -m -b --start --quiet --pidfile /var/run/$NAME.pid \
20                 --exec $DAEMON
21         echo "."
22         ;;
23   stop)
24         echo -n "Stopping $DESC$NAME"
25         start-stop-daemon -m --stop --quiet --pidfile /var/run/$NAME.pid
26         echo "."
27         ;;
28   #reload)
29         #
30         #       If the daemon can reload its config files on the fly
31         #       for example by sending it SIGHUP, do it here.
32         #
33         #       If the daemon responds to changes in its config file
34         #       directly anyway, make this a do-nothing entry.
35         #
36         # echo -n "Reloading $DESC configuration..."
37         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
38         #       /var/run/$NAME.pid --exec $DAEMON
39         # echo "done."
40   #;;
41   restart|force-reload)
42         #
43         #       If the "reload" option is implemented, move the "force-reload"
44         #       option to the "reload" entry above. If not, "force-reload" is
45         #       just the same as "restart".
46         #
47         echo -n "Restarting $DESC$NAME"
48         start-stop-daemon -m --stop --quiet --pidfile \
49                 /var/run/$NAME.pid
50         sleep 1
51         start-stop-daemon -m -b --start --quiet --pidfile \
52                 /var/run/$NAME.pid --exec $DAEMON
53         echo "."
54         ;;
55   *)
56         N=/etc/init.d/$NAME
57         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
58         echo "Usage: $N {start|stop|restart|force-reload}" >&2
59         exit 1
60         ;;
61 esac
62
63 exit 0