diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:46:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:46:31 +0000 |
commit | 32afea41ba8b7328e252ae97ca32c56f98d42a90 (patch) | |
tree | 11b25ffd59d9190c8316cd48ace4e198531d0e7d /debian/ip-down.d | |
parent | Adding upstream version 3.4.23. (diff) | |
download | postfix-32afea41ba8b7328e252ae97ca32c56f98d42a90.tar.xz postfix-32afea41ba8b7328e252ae97ca32c56f98d42a90.zip |
Adding debian version 3.4.23-0+deb10u1.debian/3.4.23-0+deb10u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/ip-down.d')
-rw-r--r-- | debian/ip-down.d | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/ip-down.d b/debian/ip-down.d new file mode 100644 index 0000000..4101554 --- /dev/null +++ b/debian/ip-down.d @@ -0,0 +1,34 @@ +#!/bin/sh -e + +# Called when an interface disconnects +# Written by LaMont Jones <lamont@debian.org> + +# start or reload Postfix as needed + +# If /usr isn't mounted yet, silently bail. +if [ ! -d /usr/lib/postfix ]; then + exit 0 +fi + +RUNNING="" +# If master is running, force a queue run to unload any mail that is +# hanging around. Yes, sendmail is a symlink... +if [ -f /var/spool/postfix/pid/master.pid ]; then + pid=$(sed 's/ //g' /var/spool/postfix/pid/master.pid) + exe=$(ls -l /proc/$pid/exe 2>/dev/null | sed 's/.* //;s/.*\///') + if [ "X$exe" = "Xmaster" ]; then + RUNNING="y" + fi +fi + +if [ ! -x /sbin/resolvconf ]; then + f=/etc/resolv.conf + if ! cp $f $(postconf -hx queue_directory)$f 2>/dev/null; then + exit 0 + fi + if [ -n "$RUNNING" ]; then + service postfix reload >/dev/null 2>&1 + fi +fi + +exit 0 |