~ubuntu-branches/ubuntu/hardy/exim4/hardy-proposed

« back to all changes in this revision

Viewing changes to debian/debconf/update-exim4.conf.template

  • Committer: Bazaar Package Importer
  • Author(s): Marc Haber
  • Date: 2005-07-02 06:08:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050702060834-qk17pd52kb9nt3bj
Tags: 4.52-1
* new upstream version 4.51. (mh)
  * adapt 70_remove_exim-users_references
  * remove 37_gnutlsparams
  * adapt 36_pcre
  * adapt 31_eximmanpage
* fix package priorities to have them in sync with override again. (mh)
* Fix error in nb (Norwegian) translation.
  Thanks to Helge Hafting. (mh). Closes: #315775
* Standards-Version: 3.6.2, no changes needed. (mh)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
CONFDIR="${CONFDIR:-/etc/exim4}"
6
6
DONOTRUN='true'
7
7
 
 
8
UPEX4CT_outputfile="${CONFDIR}/exim4.conf.template"
 
9
 
8
10
usage() {
9
11
cat <<EOF
10
12
$0 - Generate exim4 configuration file template
11
13
       Options:
12
14
       -n|--nobackup - Overwrite old template, do not take backup.
 
15
       -o|--output file - write output to file instead of ${UPEX4CT_outputfile}
13
16
       -h|--help - This message.
14
17
       -r|--run - Actually do something
15
18
EOF
17
20
 
18
21
## Parse commandline
19
22
TEMP=$(getopt -n update-exim4.conf.template \
20
 
        -l nobackup,help,run -- \
21
 
        +nhr "$@")
 
23
        -l nobackup,output:,help,run -- \
 
24
        +nohr "$@")
22
25
 
23
26
if test "$?" != 0; then
24
27
        echo "Terminating..." >&2
32
35
                        usage
33
36
                        exit 0
34
37
                ;;
 
38
                -o|--output)
 
39
                        shift
 
40
                        UPEX4CT_outputfile="$1"
 
41
                ;;
35
42
                -n|--nobackup)
36
43
                        NOBACKUP=1
37
44
                ;;
62
69
        if [ ! -d "$1" ]; then
63
70
                errormessage "$0: internal run_parts called, but $1 does not exist or is not a directory."
64
71
        fi
65
 
        for F in $(ls $1 | grep -v /CVS); do
 
72
        for F in $(ls $1 | grep -v /.svn); do
66
73
                if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
67
74
                        if [ -f "$1/$F" ] ; then
68
75
                                if [ -f "$1/${F}.rul" ] ; then
87
94
       if [ ! -d "$1" ]; then
88
95
               errormessage "$0: internal cat_parts called, but $1 does not exist or is not a directory."
89
96
       fi
90
 
       for file in `run_parts $1`; do
 
97
       for file in $(run_parts $1); do
91
98
               echo "#####################################################"
92
99
               echo "### $file"
93
100
               echo "#####################################################"
105
112
fi
106
113
 
107
114
 
108
 
if [ -e "${CONFDIR}/exim4.conf.template" ] && [ -z "$NOBACKUP" ]; then
109
 
  if [ -e "${CONFDIR}/exim4.conf.template.bak.$$" ]; then
110
 
    echo >&2 "ERR: ${CONFDIR}/exim4.conf.template.bak.$$ already exists, aborting"
 
115
if [ -e "${UPEX4CT_outputfile}" ] && [ -z "$NOBACKUP" ]; then
 
116
  if [ -e "${UPEX4CT_outputfile}.bak.$$" ]; then
 
117
    echo >&2 "ERR: ${UPEX4CT_outputfile}.bak.$$ already exists, aborting"
111
118
    exit 1
112
119
  fi
113
120
fi
114
121
 
115
 
NEWTEMPLATE=`tempfile -m644 -p ex4`
116
 
if [ -f "${CONFDIR}/exim4.conf.template" ] ; then
117
 
        chmod --reference="${CONFDIR}/exim4.conf.template" "$NEWTEMPLATE"
 
122
NEWTEMPLATE=$(tempfile -m644 -p ex4)
 
123
if [ -f "${UPEX4CT_outputfile}" ] ; then
 
124
        chmod --reference="${UPEX4CT_outputfile}" "$NEWTEMPLATE"
118
125
fi
119
126
 
120
127
# generate .template. Ugly - better alternative?
 
128
SAVEWD="$(pwd)"
121
129
cd ${CONFDIR}/conf.d
122
130
for i in main acl router transport retry rewrite auth ; do
123
131
  cat_parts $i
124
132
done > "$NEWTEMPLATE"
 
133
cd "$SAVEWD"
125
134
 
126
 
if [ -e "${CONFDIR}/exim4.conf.template" ] && [ -z "$NOBACKUP" ] ; then
127
 
        mv "${CONFDIR}/exim4.conf.template" \
128
 
                "${CONFDIR}/exim4.conf.template.bak.$$"
 
135
if [ -e "${UPEX4CT_outputfile}" ] && [ -z "$NOBACKUP" ] ; then
 
136
        mv "${UPEX4CT_outputfile}" \
 
137
                "${UPEX4CT_outputfile}.bak.$$"
129
138
fi
130
 
mv "$NEWTEMPLATE" "${CONFDIR}/exim4.conf.template"
 
139
mv "$NEWTEMPLATE" "${UPEX4CT_outputfile}"