- revert last change -- looks like overwrite with some older revision
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 24 Jan 2007 18:57:04 +0000 (18:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bluez-utils.init -> 1.13

bluez-utils.init

index d9048eb..e4716e3 100644 (file)
@@ -19,10 +19,7 @@ if [ "$UART_CONF" != "no" -a ! -f "$UART_CONF" ]; then
        UART_CONF="no"
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/bluetooth ]; then
                msg_starting bluetooth; started
@@ -78,8 +75,9 @@ case "$1" in
        else
                msg_already_running bluetooth
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/bluetooth ]; then
                if is_yes "${PAND_ENABLE}" && [ -x /usr/bin/pand ]; then
                        msg_stopping pand
@@ -118,11 +116,20 @@ case "$1" in
        else
                msg_not_running bluetooth
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   reload|force-reload)
        if [ -f /var/lock/subsys/bluetooth ]; then
@@ -130,7 +137,7 @@ case "$1" in
                killproc hcid -HUP
                RETVAL=$?
        else
-               msg_not_running bluetooth >&2
+               msg_not_running bluetooth
                exit 7
        fi
        ;;
@@ -140,11 +147,7 @@ case "$1" in
        is_yes "${SDPD_ENABLE}" && status sdpd
        is_yes "${HIDD_ENABLE}" && status hidd
        is_yes "${DUND_ENABLE}" && status dund
-       if [ -f /var/lock/subsys/bluetooth ]; then
-               exit 0
-       else
-               exit 1
-       fi              
+       exit $?
        ;;
   *)
        msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
@@ -152,6 +155,3 @@ case "$1" in
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.049295 seconds and 4 git commands to generate.