SOURCES: fail2ban.init - fixed/updated

qboosh qboosh at pld-linux.org
Thu Oct 23 16:47:42 CEST 2008


Author: qboosh                       Date: Thu Oct 23 14:47:42 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fixed/updated

---- Files affected:
SOURCES:
   fail2ban.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/fail2ban.init
diff -u SOURCES/fail2ban.init:1.1 SOURCES/fail2ban.init:1.2
--- SOURCES/fail2ban.init:1.1	Wed Oct 22 23:46:42 2008
+++ SOURCES/fail2ban.init	Thu Oct 23 16:47:36 2008
@@ -49,32 +49,48 @@
 	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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/fail2ban.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list