config is in gforge-common 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 | #!/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 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
|