#!/bin/sh set -e . /usr/share/debconf/confmodule db_capb backup db_title "GOsa-SI Database Setup" STATE=1 while true; do case "$STATE" in 1) db_input medium gosa-si/hostname || true ;; 2) db_input medium gosa-si/database || true ;; 3) db_input high gosa-si/username || true ;; 4) db_input high gosa-si/password || true ;; 5) db_input critical gosa-si/rootpw || true ;; *) # The default case catches when $STATE is greater than the # last implemented state, and breaks out of the loop. This # requires that states be numbered consecutively from 1 # with no gaps, as the default case will also be entered # if there is a break in the numbering break # exits the enclosing "while" loop ;; esac if db_go; then STATE=$(($STATE + 1)) else STATE=$(($STATE - 1)) fi done if [ $STATE -eq 1 ]; then # The user has asked to back up from the first # question. This case is problematical. Regular # dpkg and apt package installation isn’t capable # of backing up questions between packages as this # is written, so this will exit leaving the package # unconfigured - probably the best way to handle # the situation. exit 10 fi