diff options
Diffstat (limited to 'debian/ip-up.d')
-rw-r--r-- | debian/ip-up.d | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/debian/ip-up.d b/debian/ip-up.d index 200414e..56b8c96 100644 --- a/debian/ip-up.d +++ b/debian/ip-up.d @@ -1,44 +1,8 @@ -#!/bin/sh -e -# Called when a new interface comes up -# Written by LaMont Jones <lamont@debian.org> - -# don't bother to restart postfix when lo is configured. -if [ "$IFACE" = "lo" ]; then - exit 0 -fi - -# 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 - -# start or reload Postfix as needed -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 - -# If master is running, force a queue run to unload any mail that is -# hanging around. Yes, sendmail is a symlink... -if [ -n "$RUNNING" ]; then - if [ -x /usr/sbin/sendmail ]; then - # Don't propagate the exit code on failure; cf. #959864 - /usr/sbin/sendmail -q >/dev/null 2>&1 || true - fi +#! /bin/sh +# update postfix copy of resolv.conf; only default instance is handled +file=/etc/resolv.conf queue=/var/spool/postfix +if [ lo != "$IFACE" ] && [ -d $queue${file%/*} ] && [ -f /etc/postfix/main.cf ] +then # just refresh, glibc pick it up automatically + [ ! -f $file ] && rm -f $queue$file || cp -pLu $file $queue$file + #sendmail -q 2>/dev/null || : # flush mail queue fi |