#!/bin/sh -e # Called when a new interface comes up # Written by LaMont Jones # eisfair-2 version # 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/local/postfix ] then exit 0 fi RUNNING="" if [ -n "`ps -ef | grep -v grep | grep '/usr/local/postfix/master' 2>/dev/null`" ] then RUNNING="y" fi # start or reload Postfix as needed f=/etc/resolv.conf if ! cp $f $(postconf -h queue_directory)$f 2>/dev/null then exit 0 fi if [ -n "$RUNNING" ] then /etc/init.d/postfix reload >/dev/null 2>&1 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 /usr/sbin/sendmail -q >/dev/null 2>&1 fi fi