mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-25 10:03:03 +01:00
43 lines
905 B
Text
43 lines
905 B
Text
|
#!/bin/bash
|
||
|
|
||
|
PORT=10025
|
||
|
PIDFILE=/var/run/postgrey/postgrey.pid
|
||
|
USER=%POSTGREYUSR%
|
||
|
GROUP=%POSTGREYGRP%
|
||
|
HOST=mail.example.com
|
||
|
|
||
|
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 /var/run/postgrey
|
||
|
/usr/bin/postgrey -d \
|
||
|
--inet=$PORT \
|
||
|
--pidfile=/var/run/postgrey/postgrey.pid \
|
||
|
--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
|