Import Debian changes 4.92-8+deb10u3
[hcoop/debian/exim4.git] / debian / e-n-if-up
CommitLineData
de45f55a
AM
1#!/bin/bash
2
3# put this file in /etc/network/if-up.d/exim4-smarthost
4# add an exim4-smarthost smtp.server.example.com::587 line to your interface
5# stanza in /etc/network/interfaces
6
7# this will only work for split config, since in non-split config we
8# only have a single file which is included and which would need more
9# serious string processing to alter. With split config, we can blindly
10# overwrite our previous file.
11
12# Environment:
13# MODE = { start | stop }
14# IF_EXIM4_SMARTHOST = hostname[::port]
15
16SMARTHOSTFILE="/etc/exim4/conf.d/main/00_local_DCsmarthost"
17
18if [ -z "$IF_EXIM4_SMARTHOST" ]; then
19 exit 0
20fi
21
22if [ "$MODE" = 'stop' ]; then
23 rm -f $SMARTHOSTFILE
01e60269 24 invoke exim4 reload > /dev/null || true
de45f55a
AM
25 exit 0
26fi
27
28if [ "$IF_EXIM4_SMARTHOST" = "none" ]; then
29 rm -f $SMARTHOSTFILE
01e60269 30 invoke exim4 reload > /dev/null || true
de45f55a
AM
31 exit 0
32fi
33
34echo "DCsmarthost = ${IF_EXIM4_SMARTHOST}" > $SMARTHOSTFILE
35
01e60269 36invoke exim4 reload > /dev/null || true
de45f55a 37/usr/sbin/exim4 -qqf