Initial import of postgrey.
This commit is contained in:
parent
b05aa2176f
commit
69f0a0dafa
6 changed files with 282 additions and 0 deletions
85
postgrey.init
Executable file
85
postgrey.init
Executable file
|
|
@ -0,0 +1,85 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# chkconfig: - 79 31
|
||||
# description: Postfix Greylisting Policy Server
|
||||
#
|
||||
# processname: postgrey
|
||||
#
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 0
|
||||
|
||||
prog=postgrey
|
||||
postgrey=/usr/sbin/$prog
|
||||
DBPATH=/var/spool/postfix/postgrey
|
||||
SOCKET=$DBPATH/socket
|
||||
OPTIONS="--unix=$SOCKET"
|
||||
|
||||
# Source an auxiliary options file if we have one, and pick up OPTIONS,
|
||||
if [ -r /etc/sysconfig/$prog ]; then
|
||||
. /etc/sysconfig/$prog
|
||||
fi
|
||||
|
||||
[ -x $postgrey -a -d $DBPATH ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
echo -n $"Starting $prog: "
|
||||
daemon $postgrey -d $OPTIONS
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
|
||||
}
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc $postgrey
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
echo -n $"Reloading $prog: "
|
||||
killproc $postgrey -HUP
|
||||
RETVAL=$?
|
||||
echo
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
reload)
|
||||
reload
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/$prog ] && restart
|
||||
;;
|
||||
status)
|
||||
status $postgrey
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
Loading…
Add table
Add a link
Reference in a new issue