]> git.pld-linux.org Git - packages/bluez.git/blob - pand.init
- updated to 4.63
[packages/bluez.git] / pand.init
1 #!/bin/sh
2 #
3 # pand  Bluetooth Personal Area Networking Daemon
4 #
5 # chkconfig:    345 26 89
6 #
7 # description:  Bluetooth Personal Area Networking Daemon. Provides network services over Bluetooth.
8 #
9 # $Id$
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 . /etc/sysconfig/network
16
17 [ -f /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth
18
19 is_no "${NETWORKING}" && exit 0
20
21 start() {
22         # Check if the service is already running?
23         if [ ! -f /var/lock/subsys/pand ]; then
24                         msg_starting pand
25                         daemon /usr/bin/pand ${PAND_OPTIONS}
26                         RETVAL=$?
27                 touch /var/lock/subsys/pand
28         else
29                 msg_already_running pand
30         fi
31 }
32
33 stop() {
34         if [ -f /var/lock/subsys/pand ]; then
35                         msg_stopping pand
36                         killproc /usr/bin/pand
37                 rm -f /var/lock/subsys/pand
38         else
39                 msg_not_running pand
40         fi
41 }
42
43 condrestart() {
44         if [ -f /var/lock/subsys/pand ]; then
45                 stop
46                 start
47         else
48                 msg_not_running pand
49                 RETVAL=$1
50         fi
51 }
52
53 RETVAL=0
54 # See how we were called.
55 case "$1" in
56   start)
57         start
58         ;;
59   stop)
60         stop
61         ;;
62   restart|reload|force-reload)
63         stop
64         start
65         ;;
66   try-restart)
67         condrestart 0
68         ;;
69   status)
70         status pand
71         if [ -f /var/lock/subsys/pand ]; then
72                 exit 0
73         else
74                 exit 1
75         fi
76         ;;
77   *)
78         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
79         exit 3
80 esac
81
82 exit $RETVAL
This page took 0.036167 seconds and 3 git commands to generate.