[Mimedefang] patch for: service mimedefang configtest
Oliver Schulze L.
oliver at samera.com.py
Mon Jan 29 18:00:03 EST 2007
Hi,
this is a patch mainly for RH o Centos servers.
It implement the parameter configtest ala apache httpd.
- You can call:
# service mimedefang configtest
in order to check the mimedefang-filter syntax, it ends up
calling mimedefang.pl -test
- Also, it auto check the syntax before starting the mimedefang service
and stop the "start" command if the syntax is wrong.
The patch is really simple, but maybe can be helpfull to others.
HTH
Oliver
--
Oliver Schulze L. | Get my e-mail after a captcha in:
Asuncion - Paraguay | http://tinymailto.com/oliver
-------------- next part --------------
--- mimedefang 2007-01-29 16:37:03.000000000 -0300
+++ mimedefang.ori 2006-06-20 11:51:02.000000000 -0400
@@ -200,14 +200,6 @@
return $RETVAL
fi
- # check mimedefang-filter syntax
- configtest 2>/dev/null 1>/dev/null
- RETVAL=$?
- if [ $RETVAL -ne 0 ] ; then
- echo "You have an error in your mimedefang-filter. Start cancelled"
- return $RETVAL
- fi
-
echo -n "Starting $prog-multiplexor: "
[ -e $MX_SOCKET ] && rm -f $MX_SOCKET
# Tricky stuff below... "echo -E" won't work, hence the two-step.
@@ -328,19 +320,6 @@
return $RETVAL
}
-function configtest () {
- # check mimedefang-filter syntax
- echo -n "Checking syntax: "
- mimedefang.pl -test 2>/dev/null 1>/dev/null
- RETVAL=$?
- if [ $RETVAL -ne 0 ] ; then
- echo "You have an error in your mimedefang-filter"
- else
- echo "Syntax OK"
- fi
- return $RETVAL
-}
-
# See how we were called.
case "$1" in
start)
@@ -394,12 +373,9 @@
fi
fi
;;
- configtest)
- configtest
- ;;
*)
- echo "Usage: $0 {start|stop|restart|condrestart|reread|reload|status|configtest}"
+ echo "Usage: $0 {start|stop|restart|condrestart|reread|reload|status}"
exit 1
esac
More information about the MIMEDefang
mailing list