~ubuntu-branches/ubuntu/trusty/sendmail/trusty

« back to all changes in this revision

Viewing changes to debian/examples/network/if-down.d/sendmail

  • Committer: Bazaar Package Importer
  • Author(s): Richard A Nelson (Rick)
  • Date: 2009-03-01 18:45:00 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090301184500-z6683zxyomgmop6c
Tags: 8.14.3-9
Batting 1000, build-depend on quilt      Closes: #517676

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# This script is called when a network device goes down.
 
4
#                
 
5
# Here is where we'll stop sendmail if needed
 
6
#
 
7
# Written By Richard Nelson <cowboy@debian.org>
 
8
#
 
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
 
12
#
 
13
 
 
14
# These variables are for the use of the scripts run by run-parts
 
15
#IFACE=;
 
16
#IF_ADDRESS=;
 
17
#IF_PROVIDER=;
 
18
 
 
19
if [ ! -z "$IFACE" ]; then
 
20
        addr=$IF_ADDRESS;
 
21
        provider=$IF_PROVIDER;
 
22
        iface=$IFACE;
 
23
else
 
24
        addr=$1;
 
25
        provider=$2;
 
26
        iface=$3;
 
27
        fi;
 
28
 
 
29
if [ -z "$provider" ]; then
 
30
        exit 0;
 
31
        fi;
 
32
 
 
33
# Bring in some script functions to handle dynamic configuration
 
34
. /usr/share/sendmail/dynamic;
 
35
 
 
36
# Note the interface that just changed
 
37
update_interface "$iface" "STOP";
 
38
 
 
39
# If anything has been changed, update sendmail.cf and reload
 
40
update_sendmail "ifupdown";
 
41
 
 
42
exit 0;