config is in gforge-web-apache2 5.1.1-2.
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | #!/bin/sh -e
# Source debconf library.
. /usr/share/debconf/confmodule
#- beginning of included section from handle-mainconffile.config
###
# Functions to handle the main FusionForge configuration file
###
mainconfdir=/etc/fusionforge
mainconffile=$mainconfdir/fusionforge.conf
create_mainconffile () {
if [ ! -e $mainconfdir ] ; then
mkdir -p $mainconfdir
fi
if [ ! -e $mainconffile ] ; then
if [ -e /etc/gforge/gforge.conf ] ; then
cp -a /etc/gforge/gforge.conf $mainconffile
else
touch $mainconffile
fi
chmod 600 $mainconffile
fi
}
init_debconf_from_mainconffile () {
for i in $(grep -v "^ *#" $mainconffile | sort -u | cut -d= -f1) ; do
update_onevar_from_mainconfile $i
done
}
update_onevar_from_mainconfile () {
key=$1
update_onevar_from_mainconfile__retcode=0
value=$(grep ^$key= $mainconffile | tail -1 | cut -d= -f2-)
if [ ! -z "$value" ] ; then
db_set fusionforge/shared/$key $value || update_onevar_from_mainconfile__retcode=$? || true
# case $update_onevar_from_mainconfile__retcode in
# 0)
# echo "$key = $value injected into Debconf OK"
# db_fset fusionforge/shared/$key seen true || true
# ;;
# 10)
# echo "$key = $value not injected into Debconf (non-existing question maybe?)"
# ;;
# *)
# echo "Something wicked happened"
# exit 1
# ;;
# esac
fi
}
update_mainconffile () {
for key in $@ ; do
db_get fusionforge/shared/$key
val=$RET
update_onevar_mainconffile $key $val
done
}
update_onevar_mainconffile () {
key=$1
val=$2
if grep -q "^$key=" $mainconffile ; then
newval=$(echo $val | sed -e 's/@/\\@/g' -e 's/\$/\\$/g' -e 's/\//\\\//g')
perl -pi -e "s/^$key=.*/$key=$newval/" $mainconffile
else
echo "$key=$val" >> $mainconffile
fi
}
#- end of included section from handle-mainconffile.config
create_mainconffile
init_debconf_from_mainconffile
#- beginning of included section from get-pw-from-debconf.config
get_pw () { # Use Debconf to get a password
get_pw__pwname=$1
get_pw__priority=$2
get_pw__ok=''
while [ -z "$get_pw__ok" ] ; do
db_input ${get_pw__priority} ${get_pw__pwname} || get_pw__retcode=$? || true
db_input ${get_pw__priority} ${get_pw__pwname}_confirm || true
db_go
if [ "$get_pw__retcode" = 30 ] ; then
get_pw__ok="not-asked"
else
db_get ${get_pw__pwname} || true
get_pw__PW1=$RET
db_get ${get_pw__pwname}_confirm || true
get_pw__PW2=$RET
if [ "$get_pw__PW1" = "$get_pw__PW2" ] ; then
get_pw__ok="confirmed"
else
get_pw__ok="mismatch"
db_fset ${get_pw__pwname} seen false
db_fset ${get_pw__pwname}_confirm seen false
fi
fi
done
case $get_pw__ok in
not-asked)
echo "not-asked"
;;
confirmed)
echo "confirmed"
;;
*)
echo "SHOULDN'T HAVE HAPPENED"
exit 1
;;
esac
}
#- end of included section from get-pw-from-debconf.config
#- beginning of included section from create-random-pw.config
gen_random_pw () { # Generate a random password
if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible
tmp=$(dd if=/dev/urandom count=1 bs=8 2> /dev/null | md5sum | cut -b1-8)
else # ...or something else if need be.
# Last I was told, the Hurd had no /dev/urandom
# (Correct me if it has changed)
# Suggestions form something more random than $(date) are welcome
tmp=$(date | md5sum | cut -b1-8)
fi
echo $tmp
}
#- end of included section from create-random-pw.config
#- beginning of included section from host-variables.config
db_fget fusionforge/shared/ip_address seen || true
if [ "$RET" = "false" ] ; then
db_get fusionforge/shared/domain_name
db_set fusionforge/shared/ip_address $(hostname -i | cut -f1 -d" ")
fi
db_input medium fusionforge/shared/ip_address || true
db_input medium fusionforge/shared/server_admin || true
db_go || true
vars="ip_address server_admin"
update_mainconffile $vars
#- end of included section from host-variables.config
#- beginning of included section from common-variables.config
db_get fusionforge/shared/domain_name || true
if [ -z "$RET" ] ; then
hostname=$(hostname -f 2>/dev/null) || hostname=localhost
db_set fusionforge/shared/domain_name $hostname
fi
db_input medium fusionforge/shared/domain_name || true
db_go || true
db_get fusionforge/shared/server_admin || true
if [ -z "$RET" ] ; then
db_get fusionforge/shared/domain_name || true
db_set fusionforge/shared/server_admin "webmaster@$RET"
fi
db_input medium fusionforge/shared/server_admin || true
db_input low fusionforge/shared/system_name || true
db_go || true
vars="system_name domain_name server_admin"
update_mainconffile $vars
#- end of included section from common-variables.config
db_input low fusionforge/shared/sys_lang || true
db_input low fusionforge/shared/sys_theme || true
db_go || true
vars="sys_lang sys_theme newsadmin_groupid statsadmin_groupid peerrating_groupid"
update_mainconffile $vars
#- beginning of included section from groupid-variables.config
db_input low fusionforge/shared/newsadmin_groupid || true
db_input low fusionforge/shared/statsadmin_groupid || true
db_input low fusionforge/shared/peerrating_groupid || true
db_go || true
vars="newsadmin_groupid statsadmin_groupid peerrating_groupid"
update_mainconffile $vars
#- end of included section from groupid-variables.config
# [Disabled] DSFHELPER:users-variables#
# [Disabled] DSFHELPER:lists-variables#
#- beginning of included section from downloadhost-variables.config
db_fget fusionforge/shared/download_host seen || true
if [ "$RET" = "false" ] ; then
db_get fusionforge/shared/domain_name
db_set fusionforge/shared/download_host download.$RET
fi
db_input low fusionforge/shared/download_host || true
db_go || true
vars="download_host"
update_mainconffile $vars
#- end of included section from downloadhost-variables.config
db_fget fusionforge/shared/upload_host seen || true
if [ "$RET" = "false" ] ; then
db_get fusionforge/shared/domain_name
db_set fusionforge/shared/upload_host upload.$RET
fi
db_input low fusionforge/shared/upload_host || true
db_go || true
vars="upload_host"
update_mainconffile $vars
db_fget fusionforge/shared/ftpuploadhost seen || true
if [ "$RET" = "false" ] ; then
db_get fusionforge/shared/domain_name
db_set fusionforge/shared/ftpuploadhost upload.$RET
fi
db_input low fusionforge/shared/ftpuploadhost || true
db_go || true
vars="ftpuploadhost"
update_mainconffile $vars
db_fget fusionforge/shared/jabber_host seen || true
if [ "$RET" = "false" ] ; then
db_get fusionforge/shared/domain_name
db_set fusionforge/shared/jabber_host jabber.$RET
fi
db_input low fusionforge/shared/jabber_host || true
db_go || true
vars="jabber_host"
update_mainconffile $vars
# [Disabled] DSFHELPER:shellhost-variables#
# [Disabled] DSFHELPER:dbpasswd-variables#
# [Disabled] DSFHELPER:dbhost-variables#
|