postfix: updated rc script

This commit is contained in:
Matt Housh 2024-02-27 17:31:24 -06:00
parent 1a41cc8365
commit 8e30305d99
Signed by: jaeger
GPG Key ID: F9DE89ED1BFADFD7
3 changed files with 47 additions and 52 deletions

View File

@ -1,7 +1,7 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/WUeybzLyoIwG+UJG5WeTt2K6sMpBkALb814CFzGNSesrE1mvv1b3neiMw8c9gLiqeoL2gyUBdUZ2vho1DBArg4=
SHA256 (Pkgfile) = 94f7385190c51eb24e16d866c0d08b71af701ea6154ee37b045498dbc1fd64c6
RWSE3ohX2g5d/aEyU7t9tm22OdZNvzoespc54OKwRUQPNO1SRoT71M2xOkxafC3MdT5f9cF3hi76/6gKMk6bPxI+1P+/gQLsKg8=
SHA256 (Pkgfile) = b940e60f658583196ccec53b17a38bd59dac9a7a410b8dd688611f3f6a83247e
SHA256 (.footprint) = 0c117e4d6ca42a13ef6f2c030aff896a140958e8b6e96fe1ae7c682f70e588aa
SHA256 (postfix-3.8.5.tar.gz) = f3e827a2b2e410359ad25d31341970434ab07e36139f9a2ef93981b0ec564c85
SHA256 (aliases) = b6de629cce43ed5dc06086c5742ebe85ccc7b59d085f0fec71d97e0e73a50271
SHA256 (postfix.rc) = 78059f334abcf0f1662107f5b9542fba26f489d2cb0ca05cdc61a816f4e96dc7
SHA256 (postfix.rc) = 8466d9ca8e7d53f4b773de29ed113f43fb9564c74208db92a0ddea3a22ff3a4a

View File

@ -5,7 +5,7 @@
name=postfix
version=3.8.5
release=1
release=2
source=(http://ftp.porcupine.org/mirrors/postfix-release/official/${name}-${version}.tar.gz
aliases postfix.rc)

View File

@ -1,52 +1,47 @@
#!/bin/sh
######################################################################
# postfix: starts/stops postfix daemon
# description: Postfix is a Mail Transport Agent, which is the program
# that moves mail from one machine to another.
######################################################################
#
# /etc/rc.d/postfix: start/stop postfix daemon
#
daemon="/usr/sbin/postfix"
config="/etc/postfix"
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/postfix
PID=/var/spool/postfix/pid/master.pid
######################################################################
# Sanity Check
######################################################################
[ -x $daemon ] || exit 1
######################################################################
# Uncomment these if you want to rebuild aliases on restart
######################################################################
#/usr/sbin/postalias hash:$config/aliases
#/usr/sbin/postmap hash:$config/{access,canonical,relocated,transport,virtual}
#/usr/sbin/postmap hash:$config/access.{client,helo,sender,recpnt}
######################################################################
# Start/Stop/Reload/Status Functions
######################################################################
status() {
base=${daemon##*/}
dpid=`pidof -o $$ -o $PPID -o %PPID -x ${base}`
if [ "$dpid" != "" ]; then
echo "${base} (pid $dpid) is running..."
elif [ -s /var/run/${base}.pid ]; then
echo "${base} is dead but pid file exists..."
else
echo "${base} is stopped."
fi
return
}
######################################################################
# See how we were called
######################################################################
case "$1" in
start) $daemon start ;;
stop) $daemon stop ;;
reload) $daemon reload ;;
restart) $daemon reload ;;
status) status ;;
abort) $daemon abort ;;
flush) $daemon flush ;;
check) $daemon check ;;
*) echo "Usage: $0 {start|stop|reload|restart|status|abort|flush|check}" ; exit 1 ;;
case $1 in
start)
$SSD --start --exec $PROG -- start
;;
stop)
$SSD --stop --retry 10 --pidfile $PID
;;
reload)
$PROG reload
;;
restart)
$0 stop
$0 start
;;
abort)
$PROG abort
;;
check)
$PROG check
;;
flush)
$PROG flush
;;
status)
$SSD --status --pidfile $PID
case $? in
0) echo "$PROG is running with pid $(cat $PID)" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|reload|restart|abort|check|flush|status]"
;;
esac
exit $?
# End of file