From c762e73684f07813e3aa1062ccb8057898b9c418 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Mon, 20 Oct 2008 17:09:32 +0000 Subject: [PATCH] - added try-restart Changed files: bluez.init -> 1.3 --- bluez.init | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bluez.init b/bluez.init index a45ca2d..c2be378 100644 --- a/bluez.init +++ b/bluez.init @@ -122,6 +122,16 @@ stop() { fi } +condrestart() { + if [ -f /var/lock/subsys/bluetooth ]; then + stop + start + else + msg_not_running bluetooth + RETVAL=$1 + fi +} + RETVAL=0 # See how we were called. case "$1" in @@ -135,6 +145,9 @@ case "$1" in stop start ;; + try-restart) + condrestart 0 + ;; reload|force-reload) if [ -f /var/lock/subsys/bluetooth ]; then msg_reloading hcid @@ -158,7 +171,7 @@ case "$1" in fi ;; *) - msg_usage "$0 {start|stop|restart|reload|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" exit 3 esac -- 2.44.0