slackbuilds_ponce/network/postgrey/rc.postgrey
Robby Workman 5b14a05112
network/postgrey: Updated for version 1.37.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2020-08-29 10:08:38 +07:00

40 lines
851 B
Bash

#!/bin/bash
. /etc/postgrey.conf || exit 1
postgrey_start() {
echo "Starting postgrey milter: /usr/bin/postgrey -d --inet=$PORT --pidfile=$PIDFILE --user=$USER --group=$GROUP --dbdir=/var/lib/postgrey --hostname=$HOST"
mkdir -p $(dirname $PIDFILE)
chown ${USER}:${GROUP} $(dirname $PIDFILE)
/usr/bin/postgrey -d \
--inet=$PORT \
--pidfile=$PIDFILE \
--user=$USER --group=$GROUP \
--dbdir=/var/lib/postgrey \
--hostname=$HOST
}
postgrey_stop() {
if [ -e $PIDFILE ]; then
echo "Stopping postgrey milter..."
kill $(cat $PIDFILE) 1>/dev/null
fi
}
case "$1" in
'start')
postgrey_start
;;
'stop')
postgrey_stop
;;
'restart')
postgrey_stop
sleep 2
postgrey_start
;;
*)
echo "usage $0 start|stop|restart"
;;
esac