From 7ac3ca544048b70a3f7a9bcf6255614f92c50232 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 30 Nov 2006 16:36:46 +0000 Subject: [PATCH] - use functions Changed files: bluez-utils.init -> 1.10 --- bluez-utils.init | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/bluez-utils.init b/bluez-utils.init index ec15b0f..b624e71 100644 --- a/bluez-utils.init +++ b/bluez-utils.init @@ -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 ;; @@ -148,6 +155,3 @@ case "$1" in esac exit $RETVAL - -# This must be last line ! -# vi:syntax=sh:tw=78:ts=8:sw=4 -- 2.43.0