masqmail
annotate 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 |
rev | line source |
---|---|
meillo@0 | 1 #!/bin/bash -e |
meillo@0 | 2 |
meillo@0 | 3 # Source debconf library. |
meillo@0 | 4 . /usr/share/debconf/confmodule |
meillo@0 | 5 |
meillo@0 | 6 db_version 2.0 |
meillo@0 | 7 |
meillo@0 | 8 # This conf script is capable of backing up |
meillo@0 | 9 db_capb backup |
meillo@0 | 10 |
meillo@0 | 11 if [ x"$1" = x"configure" ] ; then |
meillo@0 | 12 if [ -n $2 ] ; then |
meillo@0 | 13 if dpkg --compare-versions "$2" lt "0.2.10-0.2" ; then |
meillo@0 | 14 PCMCIA_SCRIPT_UP=/etc/pcmcia/ip-up.d/1masqmail |
meillo@0 | 15 PCMCIA_SCRIPT_DOWN=/etc/pcmcia/ip-down.d/99masqmail |
meillo@0 | 16 if [ -x $PCMCIA_SCRIPT_UP ] || [ -x $PCMCIA_SCRIPT_DOWN ] ; then |
meillo@0 | 17 chmod -x $PCMCIA_SCRIPT_UP $PCMCIA_SCRIPT_DOWN |
meillo@0 | 18 db_input high masqmail/note_pcmcia_scripts || true; |
meillo@0 | 19 db_go |
meillo@0 | 20 fi |
meillo@0 | 21 fi |
meillo@0 | 22 fi |
meillo@0 | 23 fi |
meillo@0 | 24 |
meillo@0 | 25 if [ x"$1" = x"configure" ] ; then |
meillo@0 | 26 if [ -n $2 ] ; then |
meillo@0 | 27 if dpkg --compare-versions "$2" lt "0.2.17-1" ; then |
meillo@0 | 28 db_input medium masqmail/note_moved_tpl || true; |
meillo@0 | 29 db_go |
meillo@0 | 30 fi |
meillo@0 | 31 fi |
meillo@0 | 32 fi |
meillo@0 | 33 |
meillo@0 | 34 # shamelessly copied from xserver-common.config. |
meillo@0 | 35 # Thanks to Branden. :-) |
meillo@0 | 36 |
meillo@0 | 37 CONFIGFILE=/etc/masqmail/masqmail.conf |
meillo@0 | 38 |
meillo@0 | 39 ASK_TO_REPLACE= |
meillo@0 | 40 if [ -e $CONFIGFILE ]; then |
meillo@0 | 41 # does the file have debconf markers in it? |
meillo@0 | 42 if egrep -q '^### BEGIN DEBCONF SECTION' $CONFIGFILE && \ |
meillo@0 | 43 egrep -q '^### END DEBCONF SECTION' $CONFIGFILE; then |
meillo@0 | 44 PRIORITY=medium |
meillo@0 | 45 else |
meillo@0 | 46 ASK_TO_REPLACE=yes |
meillo@0 | 47 PRIORITY=high |
meillo@0 | 48 fi |
meillo@0 | 49 else |
meillo@0 | 50 PRIORITY=medium |
meillo@0 | 51 # this is for the postinst, which tests this: |
meillo@0 | 52 db_set masqmail/move_existing_nondebconf_config "true" |
meillo@0 | 53 fi |
meillo@0 | 54 |
meillo@0 | 55 # use debconf to manage configuration file? |
meillo@0 | 56 db_input $PRIORITY masqmail/manage_config_with_debconf || true |
meillo@0 | 57 db_go |
meillo@0 | 58 db_get masqmail/manage_config_with_debconf |
meillo@0 | 59 if [ "$RET" = "false" ]; then |
meillo@0 | 60 exit 0 |
meillo@0 | 61 fi |
meillo@0 | 62 |
meillo@0 | 63 # move existing configuration file out of |
meillo@0 | 64 # the way? |
meillo@0 | 65 if [ x"$ASK_TO_REPLACE" = x"yes" ]; then |
meillo@0 | 66 db_input $PRIORITY masqmail/move_existing_nondebconf_config || true |
meillo@0 | 67 db_go |
meillo@0 | 68 db_get masqmail/move_existing_nondebconf_config || true |
meillo@0 | 69 if [ "$RET" = "true" ]; then |
meillo@0 | 70 mv $CONFIGFILE $CONFIGFILE.debconf-backup |
meillo@0 | 71 else |
meillo@0 | 72 exit 0 |
meillo@0 | 73 fi |
meillo@0 | 74 fi |
meillo@0 | 75 |
meillo@0 | 76 if [ -f /etc/mailname ] ; then |
meillo@0 | 77 hostfqdn=`cat /etc/mailname` |
meillo@0 | 78 else |
meillo@0 | 79 hostfqdn=`hostname -f` |
meillo@0 | 80 fi |
meillo@0 | 81 hostname=`hostname` |
meillo@0 | 82 |
meillo@0 | 83 db_fget masqmail/host_name seen |
meillo@0 | 84 if [ "$RET" = "false" ]; then |
meillo@0 | 85 db_set masqmail/host_name ${hostfqdn} |
meillo@0 | 86 fi |
meillo@0 | 87 db_fget masqmail/local_hosts seen |
meillo@0 | 88 if [ "$RET" = "false" ]; then |
meillo@0 | 89 db_set masqmail/local_hosts "localhost;${hostname};${hostfqdn}" |
meillo@0 | 90 fi |
meillo@0 | 91 |
meillo@0 | 92 STATE=1 |
meillo@0 | 93 while [ "$STATE" != 0 -a "$STATE" != 19 ]; do |
meillo@0 | 94 case "$STATE" in |
meillo@0 | 95 1) |
meillo@0 | 96 db_input medium masqmail/host_name || true |
meillo@0 | 97 ;; |
meillo@0 | 98 2) |
meillo@0 | 99 db_input medium masqmail/local_hosts || true |
meillo@0 | 100 ;; |
meillo@0 | 101 3) |
meillo@0 | 102 db_input medium masqmail/local_nets || true |
meillo@0 | 103 ;; |
meillo@0 | 104 4) |
meillo@0 | 105 db_input medium masqmail/listen_addresses || true |
meillo@0 | 106 ;; |
meillo@0 | 107 5) |
meillo@0 | 108 db_input low masqmail/use_syslog || true |
meillo@0 | 109 ;; |
meillo@0 | 110 6) |
meillo@0 | 111 db_input medium masqmail/online_detect || true |
meillo@0 | 112 ;; |
meillo@0 | 113 7) |
meillo@0 | 114 db_get masqmail/online_detect |
meillo@0 | 115 if [ "$RET" = "file" ] ; then |
meillo@0 | 116 db_input low masqmail/online_file || true |
meillo@0 | 117 else |
meillo@0 | 118 db_input medium masqmail/online_pipe || true |
meillo@0 | 119 fi |
meillo@0 | 120 ;; |
meillo@0 | 121 8) |
meillo@0 | 122 db_input medium masqmail/mbox_default || true |
meillo@0 | 123 ;; |
meillo@0 | 124 9) |
meillo@0 | 125 db_get masqmail/mbox_default |
meillo@0 | 126 if [ "$RET" = "mda" ] ; then |
meillo@0 | 127 db_input medium masqmail/mda || true |
meillo@0 | 128 else |
meillo@0 | 129 db_input low masqmail/mda || true |
meillo@0 | 130 fi |
meillo@0 | 131 ;; |
meillo@0 | 132 10) |
meillo@0 | 133 db_input low masqmail/alias_local_caseless || true |
meillo@0 | 134 ;; |
meillo@0 | 135 11) |
meillo@0 | 136 db_input low masqmail/init_smtp_daemon || true |
meillo@0 | 137 ;; |
meillo@0 | 138 12) |
meillo@0 | 139 db_input low masqmail/init_queue_daemon || true |
meillo@0 | 140 ;; |
meillo@0 | 141 13) |
meillo@0 | 142 db_get masqmail/init_queue_daemon |
meillo@0 | 143 if [ "$RET" = "true" ] ; then |
meillo@0 | 144 db_input low masqmail/queue_daemon_ival || true |
meillo@0 | 145 fi |
meillo@0 | 146 ;; |
meillo@0 | 147 14) |
meillo@0 | 148 db_input medium masqmail/init_fetch_daemon || true |
meillo@0 | 149 ;; |
meillo@0 | 150 15) |
meillo@0 | 151 db_get masqmail/init_fetch_daemon |
meillo@0 | 152 if [ "$RET" = "true" ] ; then |
meillo@0 | 153 db_input low masqmail/fetch_daemon_ival || true |
meillo@0 | 154 fi |
meillo@0 | 155 ;; |
meillo@0 | 156 16) |
meillo@0 | 157 db_input medium masqmail/ipup_runqueue || true |
meillo@0 | 158 ;; |
meillo@0 | 159 17) |
meillo@0 | 160 db_input medium masqmail/ipup_fetch || true |
meillo@0 | 161 ;; |
meillo@0 | 162 18) |
meillo@0 | 163 db_input medium masqmail/ifup_ifaces || true |
meillo@0 | 164 ;; |
meillo@0 | 165 |
meillo@0 | 166 esac |
meillo@0 | 167 |
meillo@0 | 168 if db_go; then |
meillo@0 | 169 STATE=$(($STATE + 1)) |
meillo@0 | 170 else |
meillo@0 | 171 STATE=$(($STATE - 1)) |
meillo@0 | 172 fi |
meillo@0 | 173 done |
meillo@0 | 174 |
meillo@0 | 175 db_input medium masqmail/you_are_not_finished || true |
meillo@0 | 176 db_go |
meillo@0 | 177 |
meillo@0 | 178 # dpkg-reconfigure does not stop services: |
meillo@0 | 179 # (cause of Bug#151528) |
meillo@0 | 180 # in debhelper version < 1.2.9 |
meillo@0 | 181 |
meillo@0 | 182 DH_VERSION=`dpkg -l debconf | awk ' /^ii/ { print $3 }'` |
meillo@0 | 183 |
meillo@0 | 184 if dpkg --compare-versions $DH_VERSION lt "1.2.9" ; then |
meillo@0 | 185 if [ x"$1" = x"reconfigure" ] ; then |
meillo@0 | 186 if [ -x "/etc/init.d/masqmail" ]; then |
meillo@0 | 187 /etc/init.d/masqmail stop || true |
meillo@0 | 188 fi |
meillo@0 | 189 fi |
meillo@0 | 190 fi |
meillo@0 | 191 |
meillo@0 | 192 exit 0 |