diff options
author | Clive Lin <clive@FreeBSD.org> | 2004-10-12 09:09:24 +0000 |
---|---|---|
committer | Clive Lin <clive@FreeBSD.org> | 2004-10-12 09:09:24 +0000 |
commit | 9965df014105ca7dbdfd0c7cd0fb134ee1ef40dd (patch) | |
tree | e7e1673f4a6457b1d958ab19129f5c3afdf7c70d /mail/nullmailer/files | |
parent | af63caf140b03f2dc332b417a5ed90f6ea7b4991 (diff) | |
download | ports-9965df014105ca7dbdfd0c7cd0fb134ee1ef40dd.tar.gz ports-9965df014105ca7dbdfd0c7cd0fb134ee1ef40dd.zip |
Notes
Diffstat (limited to 'mail/nullmailer/files')
-rw-r--r-- | mail/nullmailer/files/nullmail.sh | 62 |
1 files changed, 18 insertions, 44 deletions
diff --git a/mail/nullmailer/files/nullmail.sh b/mail/nullmailer/files/nullmail.sh index d32df5c064f3..86aabf40baf2 100644 --- a/mail/nullmailer/files/nullmail.sh +++ b/mail/nullmailer/files/nullmail.sh @@ -1,48 +1,22 @@ #!/bin/sh +# $FreeBSD$ +# +# PROVIDE: nullmailer +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable nullmailer: +# +# nullmailer_enable="YES" +# -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi +. %%RC_SUBR%% -NULLMAILUSER=nullmail +name=nullmailer +rcvar=`set_rcvar` +nullmailer_user=nullmail +command=%%PREFIX%%/sbin/nullmailer-send +command_args=" | /usr/bin/logger -i -p local5.info -t nullmail &" +load_rc_config $name +run_rc_command "$1" -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 -HEAD=/usr/bin/head - -PRIORITY=local5.info -TAG=${NULLMAILUSER} - -case "$1" in -start) - echo -n ' nullmailer' - if [ ! -r ${PIDFILE} ] ; then - [ -x ${PREFIX}/sbin/nullmailer-send ] && su -l ${NULLMAILUSER} -c "${PREFIX}/sbin/nullmailer-send 2>&1 | ${LOGGER} -i -p ${PRIORITY} -t ${TAG} &" - JUNK=`${PS} -ax` - PID=`${PS} awx | ${GREP} -v awk | ${AWK} '/nullmailer-send/ {print $1}' | ${HEAD} -1` - echo $PID > ${PIDFILE} - else - echo ' already running' - fi - ;; -stop) - echo -n ' nullmailer' - if [ -r ${PIDFILE} ] ; then - ${KILL} `${CAT} ${PIDFILE}` > /dev/null - ${RM} -f ${PIDFILE} - fi - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 |