]> git.pld-linux.org Git - packages/fam.git/blobdiff - fam.init
- typo
[packages/fam.git] / fam.init
index 89d0264f46c3241ed89078b54041d00fa9fbbbf6..a3db612e4d4ddd86a2f07c4129e0cac7cc6e6a93 100644 (file)
--- a/fam.init
+++ b/fam.init
@@ -30,10 +30,11 @@ else
        exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+if [ "$1" != "stop" ]; then
+       check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
+fi
+
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/famd ]; then
                msg_starting "File Alteration Monitor"
@@ -43,8 +44,9 @@ case "$1" in
        else
                msg_already_running "File Alteration Monitor"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/famd ]; then
                msg_stopping "File Alteration Monitor"
@@ -53,15 +55,24 @@ case "$1" in
        else
                msg_not_running "File Alteration Monitor"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status famd
        exit $?
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
This page took 0.141577 seconds and 4 git commands to generate.