]> git.pld-linux.org Git - packages/bluez.git/commitdiff
- unify auto/ti/bluez-4_96-1
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 11 Sep 2011 19:35:28 +0000 (19:35 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bluez.init -> 1.9
    dund.init -> 1.3
    pand.init -> 1.3
    rfcomm.init -> 1.3

bluez.init
dund.init
pand.init
rfcomm.init

index 983b3dd77676c8909d805c48b6e244f9ff369407..6b89ff4c522349a5e4c0fa4b9fa317c7ea8a603a 100644 (file)
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/bluetooth ]; then
-               if [ -x /sbin/udevadm ]; then
-                       msg_starting "Bluetooth devices"
-                       daemon /sbin/udevadm trigger --subsystem-match=bluetooth --action=add
-                       RETVAL=$?
-                       touch /var/lock/subsys/bluetooth
-               fi
-       else
+       if [ -f /var/lock/subsys/bluetooth ]; then
                msg_already_running bluetooth
+               return
+       fi
+
+       if [ ! -x /sbin/udevadm ]; then
+               return
        fi
+
+       msg_starting "Bluetooth devices"
+       daemon /sbin/udevadm trigger --subsystem-match=bluetooth --action=add
+       RETVAL=$?
+       touch /var/lock/subsys/bluetooth
 }
 
 stop() {
-       if [ -f /var/lock/subsys/bluetooth ]; then
-               # nothing needed to stop it
-               rm -f /var/lock/subsys/bluetooth
-       else
+       if [ ! -f /var/lock/subsys/bluetooth ]; then
                msg_not_running bluetooth
+               return
        fi
+
+       # nothing needed to stop it
+       rm -f /var/lock/subsys/bluetooth
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/bluetooth ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/bluetooth ]; then
                msg_not_running bluetooth
                RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+status() {
+       if [ ! -f /var/lock/subsys/bluetooth ]; then
+               msg_not_running bluetooth
+               RETVAL=3
+               return $RETVAL
        fi
+
+       nls "bluetooth is running"
 }
 
 RETVAL=0
@@ -64,13 +79,8 @@ case "$1" in
        condrestart 0
        ;;
   status)
-       if [ -f /var/lock/subsys/bluetooth ]; then
-               nls "bluetooth is running"
-               exit 0
-       else
-               msg_not_running bluetooth
-               exit 3
-       fi
+       status
+       RETVAL=$?
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
index 6d4b7698d9a0831c1114d4628ede12ed613a26b8..d02aa2182eeb5edec0168a82582ad6e3af0cb89b 100644 (file)
--- a/dund.init
+++ b/dund.init
@@ -18,34 +18,47 @@ is_no "${NETWORKING}" && exit 0
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/dund ]; then
-               msg_starting dund
-               daemon /usr/bin/dund ${DUND_OPTIONS}
-               RETVAL=$?
-               touch /var/lock/subsys/dund
-       else
+       if [ -f /var/lock/subsys/dund ]; then
                msg_already_running dund
+               return
        fi
+
+       msg_starting dund
+       daemon /usr/bin/dund ${DUND_OPTIONS}
+       RETVAL=$?
+       touch /var/lock/subsys/dund
 }
 
 stop() {
-       if [ -f /var/lock/subsys/dund ]; then
-               msg_stopping dund
-               killproc /usr/bin/dund
-               rm -f /var/lock/subsys/dund
-       else
+       if [ ! -f /var/lock/subsys/dund ]; then
                msg_not_running dund
+               return
        fi
+
+       msg_stopping dund
+       killproc /usr/bin/dund
+       rm -f /var/lock/subsys/dund
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/dund ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/dund ]; then
                msg_not_running dund
                RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+status() {
+       if [ ! -f /var/lock/subsys/dund ]; then
+               msg_not_running dund
+               RETVAL=3
+               return $RETVAL
        fi
+
+       nls "dund is running"
 }
 
 RETVAL=0
@@ -65,13 +78,8 @@ case "$1" in
        condrestart 0
        ;;
   status)
-       if [ -f /var/lock/subsys/dund ]; then
-               nls "dund is running"
-               exit 0
-       else
-               msg_not_running dund
-               exit 3
-       fi
+       status
+       RETVAL=$?
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
index 255251a1ac0cb5a90f8b4be22853f1f3c5cf40aa..85210ab67c8f0689bc4b20d95d7b1d83478eed38 100644 (file)
--- a/pand.init
+++ b/pand.init
@@ -20,34 +20,37 @@ is_no "${NETWORKING}" && exit 0
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/pand ]; then
-               msg_starting pand
-               daemon /usr/bin/pand ${PAND_OPTIONS}
-               RETVAL=$?
-               touch /var/lock/subsys/pand
-       else
+       if [ -f /var/lock/subsys/pand ]; then
                msg_already_running pand
+               return
        fi
+
+       msg_starting pand
+       daemon /usr/bin/pand ${PAND_OPTIONS}
+       RETVAL=$?
+       touch /var/lock/subsys/pand
 }
 
 stop() {
-       if [ -f /var/lock/subsys/pand ]; then
-               msg_stopping pand
-               killproc /usr/bin/pand
-               rm -f /var/lock/subsys/pand
-       else
+       if [ ! -f /var/lock/subsys/pand ]; then
                msg_not_running pand
+               return
        fi
+
+       msg_stopping pand
+       killproc /usr/bin/pand
+       rm -f /var/lock/subsys/pand
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/pand ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/pand ]; then
                msg_not_running pand
                RETVAL=$1
+               return
        fi
+
+       stop
+       start
 }
 
 RETVAL=0
index 4eea5bafa1262314744f0b67440a02148284a549..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
+       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,13 +81,7 @@ case "$1" in
        condrestart 0
        ;;
   status)
-       if [ -f /var/lock/subsys/rfcomm ]; then
-               nls "rfcomm is running"
-               exit 0
-       else
-               msg_not_running rfcomm
-               exit 3
-       fi
+       status
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
This page took 0.061167 seconds and 4 git commands to generate.