diff options
Diffstat (limited to 'net-mail/qmail/files/1.03-r12/config-sanity-check')
-rw-r--r-- | net-mail/qmail/files/1.03-r12/config-sanity-check | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net-mail/qmail/files/1.03-r12/config-sanity-check b/net-mail/qmail/files/1.03-r12/config-sanity-check new file mode 100644 index 000000000000..77176e283500 --- /dev/null +++ b/net-mail/qmail/files/1.03-r12/config-sanity-check @@ -0,0 +1,23 @@ +#!/bin/sh +# Configuration Sanity Checking for qmail +# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/config-sanity-check,v 1.1 2003/08/12 05:47:14 robbat2 Exp $ +# This is intended solely to stop qmail eating up all your hard disk space with logs + +CONFIG_SANITY_GOOD=1 + +# check simple stuff first +if [ -z "${QMAILDUID}" -o -z "${NOFILESGID}" -o -z "${SERVICE}" ]; then + echo "SERVICE, QMAILDUID or NOFILESGID is unset in $0" + CONFIG_SANITY_GOOD=0 +fi + +# now make sure we are are on a port that is resolable to a port number +if [ -z "`getent services ${TCPSERVER_PORT}`" ]; then + CONFIG_SANITY_GOOD=0 +fi + +if [ ! "${CONFIG_SANITY_GOOD}" -eq "1" ]; then + echo "Some error detected, sleeping for 30 seconds for safety" + sleep 30s + exit 1 +fi |