5
. /usr/share/debconf/confmodule
8
# Only ask for new installations and reconfiguring.
9
# XXX Fix to not ask when installing from the CD.
10
if ([ "$1" = "configure" ] && [ -z "$2" ]); then
12
db_get maas-cluster-controller/maas-url || true
13
if [ -z "$RET" ]; then
14
# Attempt to pre-populate if installing on the region controller.
15
if [ -e /etc/maas/maas_local_settings.py ]; then
16
url=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"\"")} END{print array[2] }' /etc/maas/maas_local_settings.py)
17
# If the URL doesn't end in /MAAS then add it. This helps upgrades from
18
# precise for which the URL didn't contain /MAAS, which is now required
19
if ! echo $url | grep -qs "/MAAS$"; then
22
db_set maas-cluster-controller/maas-url "$url"
24
# Will only get here if dbconf value not already set, or
25
# /etc/maas/maas_local_settings.py doesn't exist.
26
db_input medium maas-cluster-controller/maas-url || true
32
if [ "$1" = "reconfigure" ]; then
33
db_input high maas-cluster-controller/maas-url || true