masqmail
diff debian/masqmail.config @ 0:08114f7dcc23
this is masqmail-0.2.21 from oliver kurth
author | meillo@marmaro.de |
---|---|
date | Fri, 26 Sep 2008 17:05:23 +0200 |
parents | |
children | af25f5c39d90 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/debian/masqmail.config Fri Sep 26 17:05:23 2008 +0200 1.3 @@ -0,0 +1,192 @@ 1.4 +#!/bin/bash -e 1.5 + 1.6 +# Source debconf library. 1.7 +. /usr/share/debconf/confmodule 1.8 + 1.9 +db_version 2.0 1.10 + 1.11 +# This conf script is capable of backing up 1.12 +db_capb backup 1.13 + 1.14 +if [ x"$1" = x"configure" ] ; then 1.15 + if [ -n $2 ] ; then 1.16 + if dpkg --compare-versions "$2" lt "0.2.10-0.2" ; then 1.17 + PCMCIA_SCRIPT_UP=/etc/pcmcia/ip-up.d/1masqmail 1.18 + PCMCIA_SCRIPT_DOWN=/etc/pcmcia/ip-down.d/99masqmail 1.19 + if [ -x $PCMCIA_SCRIPT_UP ] || [ -x $PCMCIA_SCRIPT_DOWN ] ; then 1.20 + chmod -x $PCMCIA_SCRIPT_UP $PCMCIA_SCRIPT_DOWN 1.21 + db_input high masqmail/note_pcmcia_scripts || true; 1.22 + db_go 1.23 + fi 1.24 + fi 1.25 + fi 1.26 +fi 1.27 + 1.28 +if [ x"$1" = x"configure" ] ; then 1.29 + if [ -n $2 ] ; then 1.30 + if dpkg --compare-versions "$2" lt "0.2.17-1" ; then 1.31 + db_input medium masqmail/note_moved_tpl || true; 1.32 + db_go 1.33 + fi 1.34 + fi 1.35 +fi 1.36 + 1.37 +# shamelessly copied from xserver-common.config. 1.38 +# Thanks to Branden. :-) 1.39 + 1.40 +CONFIGFILE=/etc/masqmail/masqmail.conf 1.41 + 1.42 +ASK_TO_REPLACE= 1.43 +if [ -e $CONFIGFILE ]; then 1.44 + # does the file have debconf markers in it? 1.45 + if egrep -q '^### BEGIN DEBCONF SECTION' $CONFIGFILE && \ 1.46 + egrep -q '^### END DEBCONF SECTION' $CONFIGFILE; then 1.47 + PRIORITY=medium 1.48 + else 1.49 + ASK_TO_REPLACE=yes 1.50 + PRIORITY=high 1.51 + fi 1.52 +else 1.53 + PRIORITY=medium 1.54 + # this is for the postinst, which tests this: 1.55 + db_set masqmail/move_existing_nondebconf_config "true" 1.56 +fi 1.57 + 1.58 +# use debconf to manage configuration file? 1.59 +db_input $PRIORITY masqmail/manage_config_with_debconf || true 1.60 +db_go 1.61 +db_get masqmail/manage_config_with_debconf 1.62 +if [ "$RET" = "false" ]; then 1.63 + exit 0 1.64 +fi 1.65 + 1.66 +# move existing configuration file out of 1.67 +# the way? 1.68 +if [ x"$ASK_TO_REPLACE" = x"yes" ]; then 1.69 + db_input $PRIORITY masqmail/move_existing_nondebconf_config || true 1.70 + db_go 1.71 + db_get masqmail/move_existing_nondebconf_config || true 1.72 + if [ "$RET" = "true" ]; then 1.73 + mv $CONFIGFILE $CONFIGFILE.debconf-backup 1.74 + else 1.75 + exit 0 1.76 + fi 1.77 +fi 1.78 + 1.79 +if [ -f /etc/mailname ] ; then 1.80 + hostfqdn=`cat /etc/mailname` 1.81 +else 1.82 + hostfqdn=`hostname -f` 1.83 +fi 1.84 +hostname=`hostname` 1.85 + 1.86 +db_fget masqmail/host_name seen 1.87 +if [ "$RET" = "false" ]; then 1.88 + db_set masqmail/host_name ${hostfqdn} 1.89 +fi 1.90 +db_fget masqmail/local_hosts seen 1.91 +if [ "$RET" = "false" ]; then 1.92 + db_set masqmail/local_hosts "localhost;${hostname};${hostfqdn}" 1.93 +fi 1.94 + 1.95 +STATE=1 1.96 +while [ "$STATE" != 0 -a "$STATE" != 19 ]; do 1.97 + case "$STATE" in 1.98 + 1) 1.99 + db_input medium masqmail/host_name || true 1.100 + ;; 1.101 + 2) 1.102 + db_input medium masqmail/local_hosts || true 1.103 + ;; 1.104 + 3) 1.105 + db_input medium masqmail/local_nets || true 1.106 + ;; 1.107 + 4) 1.108 + db_input medium masqmail/listen_addresses || true 1.109 + ;; 1.110 + 5) 1.111 + db_input low masqmail/use_syslog || true 1.112 + ;; 1.113 + 6) 1.114 + db_input medium masqmail/online_detect || true 1.115 + ;; 1.116 + 7) 1.117 + db_get masqmail/online_detect 1.118 + if [ "$RET" = "file" ] ; then 1.119 + db_input low masqmail/online_file || true 1.120 + else 1.121 + db_input medium masqmail/online_pipe || true 1.122 + fi 1.123 + ;; 1.124 + 8) 1.125 + db_input medium masqmail/mbox_default || true 1.126 + ;; 1.127 + 9) 1.128 + db_get masqmail/mbox_default 1.129 + if [ "$RET" = "mda" ] ; then 1.130 + db_input medium masqmail/mda || true 1.131 + else 1.132 + db_input low masqmail/mda || true 1.133 + fi 1.134 + ;; 1.135 + 10) 1.136 + db_input low masqmail/alias_local_caseless || true 1.137 + ;; 1.138 + 11) 1.139 + db_input low masqmail/init_smtp_daemon || true 1.140 + ;; 1.141 + 12) 1.142 + db_input low masqmail/init_queue_daemon || true 1.143 + ;; 1.144 + 13) 1.145 + db_get masqmail/init_queue_daemon 1.146 + if [ "$RET" = "true" ] ; then 1.147 + db_input low masqmail/queue_daemon_ival || true 1.148 + fi 1.149 + ;; 1.150 + 14) 1.151 + db_input medium masqmail/init_fetch_daemon || true 1.152 + ;; 1.153 + 15) 1.154 + db_get masqmail/init_fetch_daemon 1.155 + if [ "$RET" = "true" ] ; then 1.156 + db_input low masqmail/fetch_daemon_ival || true 1.157 + fi 1.158 + ;; 1.159 + 16) 1.160 + db_input medium masqmail/ipup_runqueue || true 1.161 + ;; 1.162 + 17) 1.163 + db_input medium masqmail/ipup_fetch || true 1.164 + ;; 1.165 + 18) 1.166 + db_input medium masqmail/ifup_ifaces || true 1.167 + ;; 1.168 + 1.169 + esac 1.170 + 1.171 + if db_go; then 1.172 + STATE=$(($STATE + 1)) 1.173 + else 1.174 + STATE=$(($STATE - 1)) 1.175 + fi 1.176 +done 1.177 + 1.178 +db_input medium masqmail/you_are_not_finished || true 1.179 +db_go 1.180 + 1.181 +# dpkg-reconfigure does not stop services: 1.182 +# (cause of Bug#151528) 1.183 +# in debhelper version < 1.2.9 1.184 + 1.185 +DH_VERSION=`dpkg -l debconf | awk ' /^ii/ { print $3 }'` 1.186 + 1.187 +if dpkg --compare-versions $DH_VERSION lt "1.2.9" ; then 1.188 + if [ x"$1" = x"reconfigure" ] ; then 1.189 + if [ -x "/etc/init.d/masqmail" ]; then 1.190 + /etc/init.d/masqmail stop || true 1.191 + fi 1.192 + fi 1.193 +fi 1.194 + 1.195 +exit 0