From f030383595cc5833c56e3a98d1fe6189ef542358 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 26 Nov 2007 08:24:30 +0000 Subject: [PATCH 1/1] - use functions Changed files: cpqarrayd.init -> 1.5 --- cpqarrayd.init | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/cpqarrayd.init b/cpqarrayd.init index 6bc67f7..e63d8a0 100644 --- a/cpqarrayd.init +++ b/cpqarrayd.init @@ -17,10 +17,7 @@ if [ -f /etc/sysconfig/cpqarrayd ]; then . /etc/sysconfig/cpqarrayd 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/cpqarrayd ]; then msg_starting cpqarrayd @@ -33,8 +30,9 @@ start) else msg_already_running cpqarrayd fi - ;; -stop) +} + +stop() { if [ -f /var/lock/subsys/cpqarrayd ]; then # Stop daemons. msg_stopping cpqarrayd @@ -43,11 +41,20 @@ stop) else msg_not_running cpqarrayd fi +} + +RETVAL=0 +# See how we were called. +case "$1" in +start) + start + ;; +stop) + stop ;; restart|force-reload) - $0 stop - $0 start - RETVAL=$? + stop + start ;; status) status cpqarrayd -- 2.44.0