mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-05 06:27:37 +00:00
1b914533bb
installed, not both. 2. change MASTER_SITES / add MASTER_SITE_SUBDIR 3. amavisd depends on Net::SMTP, not Net::Telnet 4. bump PORTREVISION PR: 38469 Submitted by: Yen-Ming Lee <leeym@utopia.leeym.com> Approved by: maintainer
32 lines
1.2 KiB
Bash
32 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
|
|
echo "$0: Cannot determine the PREFIX" >&2
|
|
exit 1
|
|
fi
|
|
|
|
case "$1" in
|
|
start)
|
|
( [ -x ${PREFIX}/sbin/amavisd ] || [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
|
|
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
|
|
AMAVIS_MILTER=$(/bin/ps -xU %%AMAVISUSER%% | grep amavis-milter | awk '{ print $1 }')
|
|
( /bin/test "$AMAVISD" || /bin/test "$AMAVIS_MILTER" ) && \
|
|
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD $AMAVIS_MILTER" > /dev/null
|
|
rm -rf /var/amavis/amavis*.sock
|
|
su - %%AMAVISUSER%% -c "${PREFIX}/sbin/amavis-milter -D -p /var/amavis/amavis-milter.sock" > /dev/null
|
|
su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd-milter'
|
|
;;
|
|
stop)
|
|
( [ -x ${PREFIX}/sbin/amavisd ] || [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
|
|
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
|
|
AMAVIS_MILTER=$(/bin/ps -xU %%AMAVISUSER%% | grep amavis-milter | awk '{ print $1 }')
|
|
( /bin/test "$AMAVISD" || /bin/test "$AMAVIS_MILTER" ) && \
|
|
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD $AMAVIS_MILTER" > /dev/null && echo -n ' amavisd-milter'
|
|
;;
|
|
*)
|
|
echo "Usage: `basename $0` {start|stop}" >&2
|
|
;;
|
|
esac
|
|
|
|
exit 0
|