]> git.pld-linux.org Git - packages/fail2ban.git/commitdiff
- fixed/updated
authorJakub Bogusz <qboosh@pld-linux.org>
Thu, 23 Oct 2008 14:47:36 +0000 (14:47 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    fail2ban.init -> 1.2

fail2ban.init

index ffb2052bee911b33dd062ab3fb44ea5d19f1766c..7e72f879139b044848e0fa3eee6698390f189764 100644 (file)
@@ -49,32 +49,48 @@ stop() {
        if [ -f /var/lock/subsys/fail2ban ]; then
                msg_stopping fail2ban
                daemon /usr/bin/fail2ban-client stop
-                rm -f /var/lock/subsys/fail2ban /var/run/fail2ban.pid >/dev/null 2>&1
+               rm -f /var/lock/subsys/fail2ban /var/run/fail2ban.pid >/dev/null 2>&1
        else
                msg_not_running fail2ban
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/fail2ban ]; then
+               stop
+               start
+       else
+               msg_not_running fail2ban
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
        ;;
   status)
        status fail2ban
        RETVAL=$?
        /usr/bin/fail2ban-client status
        ;;
-  restart|reload)
-       stop
-       start
-       ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
        ;;
 esac
This page took 0.279659 seconds and 4 git commands to generate.