]> git.pld-linux.org Git - packages/bluez.git/blobdiff - rfcomm.init
- updated to 5.11
[packages/bluez.git] / rfcomm.init
index 006c535b4b29e3afb9ca0f8cb6f14f0b2f51660b..a59ba0a2b95f778d0a82b638bcfa0eb8adfe6a72 100644 (file)
@@ -21,34 +21,47 @@ fi
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/rfcomm ]; then
-               msg_starting rfcomm
-               daemon /usr/bin/rfcomm -f /etc/bluetooth/rfcomm.conf bind all
-               RETVAL=$?
-               touch /var/lock/subsys/rfcomm
-       else
+       if [ -f /var/lock/subsys/rfcomm ]; then
                msg_already_running rfcomm
+               return
        fi
+
+       msg_starting rfcomm
+       daemon /usr/bin/rfcomm -f /etc/bluetooth/rfcomm.conf bind all
+       RETVAL=$?
+       touch /var/lock/subsys/rfcomm
 }
 
 stop() {
-       if [ -f /var/lock/subsys/rfcomm ]; then
-               msg_stopping rfcomm
-               daemon /usr/bin/rfcomm release all
-               rm -f /var/lock/subsys/rfcomm
-       else
-               msg_not_running bluetooth
+       if [ ! -f /var/lock/subsys/rfcomm ]; then
+               msg_not_running rfcomm
+               return
        fi
+
+       msg_stopping rfcomm
+       daemon /usr/bin/rfcomm release all
+       rm -f /var/lock/subsys/rfcomm
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/rfcomm ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/rfcomm ]; then
                msg_not_running rfcomm
                RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+status() {
+       if [ ! -f /var/lock/subsys/rfcomm ]; then
+               msg_not_running rfcomm
+               RETVAL=3
+               return
        fi
+
+       nls "rfcomm is running"
 }
 
 RETVAL=0
@@ -68,11 +81,7 @@ case "$1" in
        condrestart 0
        ;;
   status)
-       if [ -f /var/lock/subsys/rfcomm ]; then
-               exit 0
-       else
-               exit 1
-       fi
+       status
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
This page took 0.032791 seconds and 4 git commands to generate.