X-Git-Url: http://git.pld-linux.org/?p=packages%2Fbluez-utils.git;a=blobdiff_plain;f=bluez-utils.init;h=aae15d9a1d796061ea44181ddcac50a07a1acc38;hp=4de86b0ca38ed78250fe4d3a50062589f4e82b28;hb=687a9261e6d53e04285b9fa2eff5b6611ee89540;hpb=79f13a51c1bcfc51afd4e80d182a5d2bc4491694 diff --git a/bluez-utils.init b/bluez-utils.init index 4de86b0..aae15d9 100644 --- a/bluez-utils.init +++ b/bluez-utils.init @@ -19,6 +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) @@ -50,7 +51,6 @@ case "$1" in else # show "%s service is already running." Bluetooth msg_already_running Bluetooth - exit 1 fi ;; stop) @@ -62,7 +62,6 @@ case "$1" in # show "Stopping %s service" Bluetooth msg_stopping Bluetooth killproc hcid - RETVAL=$? if [ "$UART_CONF" != "no" ]; then killproc hciattach >/dev/null 2>&1 fi @@ -70,39 +69,33 @@ case "$1" in else # show "%s service is not running." Bluetooth msg_not_running Bluetooth - exit 1 fi ;; restart) $0 stop $0 start + exit $? ;; - reload) + reload|force-reload) if [ -f /var/lock/subsys/bluetooth ]; then # show "Reload %s service" Bluetooth msg_reloading Bluetooth - busy killproc hcid -HUP RETVAL=$? - [ $RETVAL -eq 0 ] && ok || died else # show "%s service is not running." Bluetooth - msg_not_running Bluetooth - RETVAL=1 + msg_not_running Bluetooth >&2 + exit 7 fi ;; - force-reload) - # if program allows reloading without stopping - $0 reload - ;; status) status hcid - RETVAL=$? + exit $? ;; *) # show "Usage: %s {start|stop|restart|reload|force-reload|status}" msg_usage "$0 {start|stop|restart|reload|force-reload|status}" - exit 1 + exit 3 esac exit $RETVAL