config is in quota 4.00-3.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | #! /bin/sh
set -e
# We need debconf
. /usr/share/debconf/confmodule
# The following function does the real stuff
debconf_dialog() {
# Ask the user if he wants this stuff at all
db_input medium quota/run_warnquota || true
db_go
# Ask more questions if warnquota enabled
db_get quota/run_warnquota
if [ "$RET" = "true" ]; then
# Set the defaults for email addresses
if [ -f /etc/mailname ]; then
email="root@`cat /etc/mailname`"
else
email="root@`hostname -f`"
fi
db_fget quota/mailfrom seen
if [ "$RET" = "false" ]; then
db_set quota/mailfrom "$email"
fi
db_fget quota/supportemail seen
if [ "$RET" = "false" ]; then
db_set quota/supportemail "$email"
fi
db_fget quota/message seen
if [ "$RET" = "false" ]; then
db_set quota/message ""
fi
db_fget quota/signature seen
if [ "$RET" = "false" ]; then
db_set quota/signature ""
fi
db_fget quota/subject seen
if [ "$RET" = "false" ]; then
db_set quota/subject ""
fi
db_fget quota/cc seen
if [ "$RET" = "false" ]; then
db_set quota/cc ""
fi
db_fget quota/charset seen
if [ "$RET" = "false" ]; then
db_set quota/charset ""
fi
db_fget quota/cc_before seen
if [ "$RET" = "false" ]; then
db_set quota/cc_before ""
fi
db_fget quota/group_message seen
if [ "$RET" = "false" ]; then
db_set quota/group_message ""
fi
db_fget quota/group_signature seen
if [ "$RET" = "false" ]; then
db_set quota/group_signature ""
fi
# Now ask the user
db_input medium quota/supportemail || true
db_input high quota/supportphone || true
db_input low quota/mailfrom || true
db_input low quota/message || true
db_input low quota/signature || true
db_input low quota/subject || true
db_input low quota/cc || true
db_input low quota/charset || true
db_input low quota/cc_before || true
db_input low quota/group_message || true
db_input low quota/group_signature || true
db_go
# If we did not get a support phone we'll set it to "*unknown*"
db_get quota/supportphone
if [ -z "$RET" ]; then
db_set quota/supportphone "*unknown*"
fi
fi
}
# Check if we need to run the configuration dialog
# a) explicitely requested
if [ "$1" = "reconfigure" ]; then
debconf_dialog
# Move the old configuration files out of the way
rm -f /etc/warnquota.conf /etc/default/quota
fi
# b) new installation
if [ "$1" = "configure" ] && [ -z "$2" ]; then
debconf_dialog
db_get quota/run_warnquota
if [ "$RET" = "true" ]; then
# Move the old configuration file out of the way
rm -f /etc/warnquota.conf /etc/default/quota
fi
fi
# c) upgrading from before debconf
# In this case only the debconf data is updated - it is not written to
# the config file, only after dpkg-reconfigure something will happen.
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "3.03-4"; then
# Figure out what we can from /etc/warnquota.conf
if grep -q "<enter your phone number here>" /etc/warnquota.conf; then
db_set quota/run_warnquota false
db_fset quota/run_warnquota seen true
db_set quota/supportphone "*unknown*"
else
db_set quota/run_warnquota true
db_fset quota/run_warnquota seen true
db_set quota/mailfrom \
"`sed -n 's/^FROM[^=]*=[[:space:]]*"\([^"]*\)"$/\1/p' \
/etc/warnquota.conf`"
db_fset quota/mailfrom seen true
db_set quota/supportemail \
"`sed -n 's/^SUPPORT[^=]*=[[:space:]]*"\([^"]*\)"$/\1/p' \
/etc/warnquota.conf`"
db_fset quota/supportemail seen true
db_set quota/supportphone \
"`sed -n 's/^PHONE[^=]*=[[:space:]]*"\([^"]*\)"$/\1/p' \
/etc/warnquota.conf`"
db_fset quota/supportphone seen true
fi
fi
# d) upgrading changes behaviour of rpc.rquotad
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "3.06-1"; then
db_input high quota/rquota_setquota || true
db_go
fi
# e) upgrading add warnquota group email
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "3.06-2"; then
db_input low quota/group_message || true
db_input low quota/group_signature || true
db_go
fi
# f) upgrading from a version that did not ask for SUBJECT and CC
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "3.11-1"; then
# Figure out what we can from /etc/warnquota.conf
db_set quota/subject \
"`sed -n 's/^SUBJECT[^=]*=[[:space:]]*"\([^"]*\)"$/\1/p' \
/etc/warnquota.conf`"
db_fset quota/subject seen true
db_set quota/cc \
"`sed -n 's/^CC_TO[^=]*=[[:space:]]*"\([^"]*\)"$/\1/p' \
/etc/warnquota.conf`"
db_fset quota/cc seen true
fi
# g) upgrading from a version that did not have CC_BEFORE
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "3.11-4"; then
# Ask the question only if warnquota enabled
db_get quota/run_warnquota
if [ "$RET" = "true" ]; then
db_input low quota/cc_before || true
db_go
fi
fi
# h) upgrading from a version that did not have CHARSET
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "3.16-1"; then
# Ask the question only if warnquota enabled
db_get quota/run_warnquota
if [ "$RET" = "true" ]; then
db_input low quota/charset || true
db_go
fi
fi
|