3
# This script is called when a dhcp event occurs.
5
# Here is where we'll start/stop sendmail if needed.
7
# Written By Richard Nelson <cowboy@debian.org>
9
# NOTE: The following lines (without the #) must be in /etc/mail/sendmail.mc:
10
# include(`/etc/mail/dialup.m4')dnl
11
# include(`/etc/mail/provider.m4')dnl
13
# NOTE: The dhcp DNS name is used as the peer name in /etc/mail/peers.
16
# No need to continue if we're called with an unsupported option
18
EXPIRE|FAIL|RELEASE|STOP) #down... and TIMEOUT too ???
20
BOUND|RENEW|REBIND|REBOOT|TIMEOUT) #up... why TIMEOUT here ???
27
# Bring in some script functions to handle dynamic configuration
28
. /usr/share/sendmail/dynamic;
30
# Note the interface that just changed
31
update_interface "$interface" "$reason";
33
# If the domain name has changed, update the provider information
34
if [ "$new_domain_name" != "$old_domain_name" ]; then
35
update_provider "$new_domain_name";
38
# If the ip address has changed, update the host information
39
if [ "$new_ip_address" != "$oldnew_ip_address" ]; then
40
update_host "$new_ip_address";
43
# If anything has been changed, update sendmail.cf and reload
44
# Actually, we'll delay the reload because we'll be hit in a moment
45
# to handle the change by /etc/network/if-up.d/sendmail
46
update_sendmail "dhcp" Delayed;