From 9e5408c5a566619db24b2245868a3a414f9d4dbd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 28 Feb 2022 13:15:01 +0100 Subject: tmp --- share/build-scripts/debconf.d/0003-debconf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'share/build-scripts/debconf.d/0003-debconf') 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 # @@ -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`" -- cgit v1.2.3