summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xshare/build-scripts/debconf.d/0003-debconf19
1 files changed, 18 insertions, 1 deletions
diff --git a/share/build-scripts/debconf.d/0003-debconf b/share/build-scripts/debconf.d/0003-debconf
index 4b6a57f..f8e9cc1 100755
--- a/share/build-scripts/debconf.d/0003-debconf
+++ b/share/build-scripts/debconf.d/0003-debconf
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -x
# Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
@@ -24,6 +24,14 @@ export DEBCONF_NOWARNINGS
. /usr/share/debconf/confmodule
+if [ -e /usr/bin/kdig ]
+then
+ DIG="/usr/bin/kdig"
+elif [ -e /usr/bin/dig ]
+then
+ DIG="/usr/bin/dig"
+fi
+
Mode ()
{
db_get container/mode
@@ -1076,6 +1084,11 @@ Network ()
echo "NETWORK${NUMBER}_IPV4_ADDRESS_DNS=\"${ADDRESS_DNS}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
eval ADDRESS="$`echo NETWORK${NUMBER}_IPV4_ADDRESS`"
+ echo DEBUG DEBUG
+ if [ -n "${ADDRESS_DNS}" ] && [ -z "${ADDRESS}" ] && [ -n "${DIG}" ]
+ then
+ ADDRESS="$(${DIG} A +short ${ADDRESS_DNS} | tail -n1)"
+ fi
echo "NETWORK${NUMBER}_IPV4_ADDRESS=\"${ADDRESS}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
eval GATEWAY="$`echo NETWORK${NUMBER}_IPV4_GATEWAY`"
@@ -1100,6 +1113,10 @@ Network ()
echo "NETWORK${NUMBER}_IPV6_ADDRESS_DNS=\"${ADDRESS_DNS}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
eval ADDRESS="$`echo NETWORK${NUMBER}_IPV6_ADDRESS`"
+ if [ -n "${ADDRESS_DNS}" ] && [ -z "${ADDRESS}" ]
+ then
+ ADDRESS="$(${DIG} AAAA +short ${ADDRESS_DNS} | tail -n1)"
+ fi
echo "NETWORK${NUMBER}_IPV6_ADDRESS=\"${ADDRESS}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
eval GATEWAY="$`echo NETWORK${NUMBER}_IPV6_GATEWAY`"