#!/bin/sh -e # Source debconf library. . /usr/share/debconf/confmodule db_version 2.0 db_capb backup STATE=1 while [ "$STATE" != 0 -a "$STATE" != 11 ] do case "$STATE" in 1) db_input critical dotlrn/db_host || true if db_go; then db_get dotlrn/db_host || true if [ ! -z "$RET" ]; then STATE=2 fi else STATE=1 fi ;; 2) db_input critical dotlrn/dba_name || true if db_go; then db_get dotlrn/dba_name || true if [ ! -z "$RET" ]; then STATE=3 fi else STATE=1 fi ;; 3) db_input critical dotlrn/dba_password || true if db_go; then db_get dotlrn/dba_password || true STATE=4 else STATE=2 fi ;; 4) db_input critical dotlrn/dba_confirm || true if db_go; then db_get dotlrn/dba_confirm || true CONFIRM="$RET" db_get dotlrn/dba_password || true if [ "$RET" != "$CONFIRM" ]; then STATE=5 else STATE=6 fi else STATE=2 fi ;; 5) db_input critical dotlrn/mismatch || true db_go STATE=3 ;; 6) db_input critical dotlrn/dbu_name || true if db_go; then db_get dotlrn/dbu_name || true if [ ! -z "$RET" ]; then STATE=7 fi else STATE=2 fi ;; 7) db_input critical dotlrn/dbu_password || true if db_go; then db_get dotlrn/dbu_password || true STATE=8 else STATE=6 fi ;; 8) db_input critical dotlrn/dbu_confirm || true if db_go; then db_get dotlrn/dbu_confirm || true CONFIRM="$RET" db_get dotlrn/dbu_password || true if [ "$RET" != "$CONFIRM" ]; then STATE=9 else STATE=10 fi else STATE=6 fi ;; 9) db_input critical dotlrn/mismatch || true db_go STATE=6 ;; 10) db_input critical dotlrn/create_tables || true db_go STATE=11 ;; esac done if [ "$STATE" = 0 ]; then db_input critical dotlrn/notconfigured || true db_go exit 1 fi