80 lines
1.9 KiB
Bash
Executable File
80 lines
1.9 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Author: Berkan Eskikaya <berkan@runtime-collective.com>, 2004
|
|
#
|
|
# $Id: config,v 1.1.1.1 2004/11/12 10:13:00 fabrice Exp $
|
|
|
|
set -e
|
|
|
|
. /usr/share/debconf/confmodule
|
|
db_capb backup
|
|
|
|
HOSTNAME=`hostname -f` 2>/dev/null || true
|
|
|
|
if [ -n "$HOSTNAME" ]; then
|
|
db_metaget ccm/shared/waf_web_server default || true
|
|
PORTNUM=`echo $RET | cut -d: -f2`
|
|
db_set ccm/shared/waf_web_server "$HOSTNAME:$PORTNUM" || true
|
|
fi
|
|
|
|
if [ -n "$EMAIL" ]; then
|
|
db_set ccm/shared/waf_admin_email "$EMAIL" || true
|
|
fi
|
|
|
|
|
|
STATE=1
|
|
LASTSTATE=5
|
|
|
|
while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
|
|
case "$STATE" in
|
|
1)
|
|
# Database questions
|
|
db_input high ccm/shared/dbase_type || true
|
|
db_input high ccm/shared/dbase_host || true
|
|
db_input high ccm/shared/dbase_name || true
|
|
db_input high ccm/shared/dbase_user || true
|
|
db_input high ccm/shared/dbase_password || true
|
|
|
|
;;
|
|
2)
|
|
# Server address
|
|
db_input high ccm/shared/waf_web_server || true
|
|
;;
|
|
3)
|
|
# Admin questions
|
|
db_input high ccm/shared/waf_admin_email || true
|
|
db_input high ccm/shared/waf_admin_name_given || true
|
|
db_input high ccm/shared/waf_admin_name_family || true
|
|
db_input high ccm/shared/waf_admin_password || true
|
|
db_input high ccm/shared/waf_admin_password_question || true
|
|
db_input high ccm/shared/waf_admin_password_answer || true
|
|
;;
|
|
4)
|
|
# When to load the applications
|
|
db_input medium ccm/shared/ccm_load_apps_at_install_p || true
|
|
;;
|
|
5)
|
|
# Whether to set up the [local] database
|
|
db_get ccm/shared/dbase_host || true
|
|
if [ "$RET" = "localhost" ]; then
|
|
db_input medium ccm/shared/pg_set_up_database_p || true
|
|
fi
|
|
;;
|
|
|
|
# Add additional states here, making sure to
|
|
# increment LASTSTATE.
|
|
esac
|
|
|
|
if db_go; then
|
|
STATE=$(($STATE + 1))
|
|
else
|
|
STATE=$(($STATE - 1))
|
|
fi
|
|
done
|
|
|
|
|
|
db_go || true
|
|
|
|
db_stop
|
|
|