From: <los...@us...> - 2006-12-17 22:32:41
|
Revision: 491 http://svn.sourceforge.net/fail2ban/?rev=491&view=rev Author: lostcontrol Date: 2006-12-17 14:32:40 -0800 (Sun, 17 Dec 2006) Log Message: ----------- - Fixed restart. Wait for the server to shutdown Modified Paths: -------------- trunk/files/gentoo-initd Property Changed: ---------------- trunk/files/gentoo-initd Modified: trunk/files/gentoo-initd =================================================================== --- trunk/files/gentoo-initd 2006-12-15 23:02:12 UTC (rev 490) +++ trunk/files/gentoo-initd 2006-12-17 22:32:40 UTC (rev 491) @@ -17,7 +17,7 @@ # # Author: Sireyessire, Cyril Jaquier # -# $Revision: 1.2 $ +# $Revision$ opts="start stop restart reload showlog" @@ -41,6 +41,32 @@ eend $? "Failed to stop fail2ban" } +restart() { + if ! service_stopped "${SVCNAME}" ; then + svc_stop || return "$?" + einfon "Waiting for server to shutdown ." + cnt=0 + while [ 1 ]; do + # Ping fail2ban-server + ${FAIL2BAN} ping &> /dev/null + if [ ! "$?" == "0" ]; then + break + fi + cnt=`expr $cnt + 1` + if [ $cnt -gt 60 ] ; then + # We have waited 1 minute. Failed + echo + eend 1 "Failed" + break + fi + sleep 1 + echo -n "." + done + echo + fi + svc_start +} + reload() { ebegin "Reloading fail2ban" ${FAIL2BAN} reload > /dev/null Property changes on: trunk/files/gentoo-initd ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |