diff options
author | Clive Lin <clive@FreeBSD.org> | 2001-02-21 02:25:59 +0000 |
---|---|---|
committer | Clive Lin <clive@FreeBSD.org> | 2001-02-21 02:25:59 +0000 |
commit | 5ce84d162d86e8ad4f3ccb60f794df05257e239f (patch) | |
tree | f535eadeed578d8ad7f653b9dcca3bbc5ef6d4ac /mail/nullmailer/files | |
parent | 7cab70d9a8c82a1526515c6ad06a51cb11ff2906 (diff) |
Notes
Diffstat (limited to 'mail/nullmailer/files')
-rw-r--r-- | mail/nullmailer/files/nullmail.sh | 46 | ||||
-rw-r--r-- | mail/nullmailer/files/remotes.sample | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/mail/nullmailer/files/nullmail.sh b/mail/nullmailer/files/nullmail.sh new file mode 100644 index 000000000000..ec009936de4e --- /dev/null +++ b/mail/nullmailer/files/nullmail.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +NULLMAILUSER=nullmail + +PIDFILE=/var/run/nullmailer.pid +AWK=/usr/bin/awk +CAT=/bin/cat +GREP=/usr/bin/grep +PS=/bin/ps +RM=/bin/rm +LOGGER=/usr/bin/logger +KILL=/bin/kill +KILLALL=/usr/bin/killall + +PRIORITY=local5.info +TAG=${NULLMAILUSER} + +case "$1" in +start) + if [ ! -r ${PIDFILE} ] ; then + [ -x ${PREFIX}/sbin/nullmailer-send ] && su -l ${NULLMAILUSER} -c "${PREFIX}/sbin/nullmailer-send | ${LOGGER} -p ${PRIORITY} -t ${TAG} 2>&1 &" && echo -n ' nullmailer' + JUNK=`${PS} -ax` + PID=`${PS} -ax | ${GREP} -e nullmailer-send$ | ${AWK} '{print $1}'` + echo $PID > ${PIDFILE} + else + echo 'nullmailer already running' + fi + ;; +stop) + if [ -r ${PIDFILE} ] ; then +# ${KILL} -15 `${CAT} ${PIDFILE}` > /dev/null && echo -n ' nullmailer' + ${KILLALL} -15 nullmailer-send > /dev/null && echo -n ' nullmailer' + ${RM} -f ${PIDFILE} + fi + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 diff --git a/mail/nullmailer/files/remotes.sample b/mail/nullmailer/files/remotes.sample new file mode 100644 index 000000000000..458605c64a88 --- /dev/null +++ b/mail/nullmailer/files/remotes.sample @@ -0,0 +1 @@ +localhost smtp |