egroupware_official/debian/egroupware-core.config
2007-02-26 09:22:01 +00:00

92 lines
2.0 KiB
Bash

#! /bin/sh
set -e
. /usr/share/debconf/confmodule
db_version 2.0
db_capb backup
step=0
finished="false"
while ! $finished ; do
skip="false"
forward=1
backward=1
password=""
confirm=""
case $step in
0) # Prompt user for notes.
db_beginblock
db_subst "egroupware/configuration/note" "site" `hostname -f`
db_input high "egroupware/configuration/note" || true
db_endblock
backward=0
;;
1) # Ask for web server type.
db_input high "egroupware/webserver" || true
;;
2) # Prompt for header admin user.
db_input high "egroupware/header/user" || true
;;
3) # Prompt for header admin password.
db_fset "egroupware/header/password/mismatch" "seen" "false" || true
db_beginblock
db_input high "egroupware/header/password" || true
db_input high "egroupware/header/password/confirm" || true
db_endblock
# Skip previous step
backward=2
;;
4) # Check if passwords match.
db_get "egroupware/header/password"
password="$RET"
db_get "egroupware/header/password/confirm"
confirm="$RET"
if [ "$password" != "$confirm" ] ; then
# Reset the template used.
db_reset "egroupware/header/password" || true
db_fset "egroupware/header/password" "seen" "false" || true
db_reset "egroupware/header/password/confirm" || true
db_fset "egroupware/header/password/confirm" "seen" "false" || true
# Prompt the user.
db_input high "egroupware/header/password/mismatch" || true
# Do one step back anyway.
forward=-1
else
# Do not prompt, go to the next step.
skip="true"
fi
;;
*)
skip="true"
message="Unknown step #$tep."
if [ $step -lt 0 ] ; then
step=-1
elif [ $step -gt 11 ] ; then
finished="true"
fi
;;
esac
if $skip ; then
next=$(($step + 1))
eval $onsuccess
onsuccess=''
else
db_title "eGroupWare" || true
if db_go ; then
next=$(($step + $forward))
eval $onsuccess
onsuccess=''
else
next=$(($step - $backward))
onsuccess=''
fi
fi
step=$next
done
db_stop