]> git.pld-linux.org Git - packages/fetchmail.git/blobdiff - fetchmail.init
- obsolete
[packages/fetchmail.git] / fetchmail.init
index 62d9cebb0759329df2169955829dd6ca7e6dcdc0..9992a679d8b9fae7019c1c0bec5c7a538c19a7bc 100644 (file)
@@ -33,10 +33,7 @@ fi
 # Check that fetchmailrc exists.
 [ -f /etc/fetchmailrc ] || exit 0
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        if [ ! -f /var/lock/subsys/fetchmail ]; then
                msg_starting "fetchmail"
 
@@ -48,8 +45,9 @@ case "$1" in
        else
                msg_already_running fetchmail
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/fetchmail ]; then
                msg_stopping "fetchmail"
                killproc fetchmail
@@ -57,11 +55,20 @@ case "$1" in
        else
                msg_not_running "fetchmail"
        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/fetchmail ]; then
@@ -69,7 +76,7 @@ case "$1" in
                killproc fetchmail -HUP
                RETVAL=$?
        else
-               msg_not_running fetchmail >&2
+               msg_not_running fetchmail
                exit 7
        fi
        ;;
This page took 0.029153 seconds and 4 git commands to generate.