From d96129db559ad8e959ceba1d9ced40cf7431eacf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 8 Feb 2007 23:38:30 +0000 Subject: [PATCH] - use functions Changed files: eventum-irc.init -> 1.10 --- eventum-irc.init | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/eventum-irc.init b/eventum-irc.init index 84dfeb5..b81be02 100644 --- a/eventum-irc.init +++ b/eventum-irc.init @@ -24,10 +24,7 @@ else exit 0 fi -RETVAL=0 -# See how we were called. -case "$1" in -start) +start() { if [ ! -f /var/lock/subsys/eventum-irc ]; then msg_starting "Eventum IRC Bot" start-stop-daemon --start \ @@ -46,8 +43,9 @@ start) else msg_already_running "Eventum IRC Bot" fi -;; -stop) +} + +stop() { if [ -f /var/lock/subsys/eventum-irc ]; then msg_stopping "Eventum IRC Bot" if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then @@ -59,11 +57,20 @@ stop) else msg_not_running "Eventum IRC Bot" fi +} + +RETVAL=0 +# See how we were called. +case "$1" in +start) + start +;; +stop) + stop ;; restart) - $0 stop - $0 start - exit $? + stop + start ;; status) status eventum-bot php -- 2.44.0