From 84cc416d5db2ed05bdb22471690ec9e443b41e3c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 19 Mar 2019 14:12:05 +0100 Subject: Adding initial support for IPv6 in debconf container create script. Note that this also removes support for non-CIDR IPv4 subnetmasks, e.g. '255.255.255.0' now has to be specified as '24'. Signed-off-by: Daniel Baumann --- share/scripts/debconf.d/0002-preseed-debconf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share/scripts/debconf.d/0002-preseed-debconf') diff --git a/share/scripts/debconf.d/0002-preseed-debconf b/share/scripts/debconf.d/0002-preseed-debconf index 9aca6bf..8877654 100755 --- a/share/scripts/debconf.d/0002-preseed-debconf +++ b/share/scripts/debconf.d/0002-preseed-debconf @@ -83,11 +83,13 @@ do if [ -n "${DIG}" ] then - IPV4_ADDRESS1="$(${DIG} +short ${NAME} | tail -n1)" + IPV4_ADDRESS1="$(${DIG} A +short ${NAME} | tail -n1)" IPV4_ADDRESS1_PART1="$(echo ${IPV4_ADDRESS1} | cut -d. -f1)" IPV4_ADDRESS1_PART2="$(echo ${IPV4_ADDRESS1} | cut -d. -f2)" IPV4_ADDRESS1_PART3="$(echo ${IPV4_ADDRESS1} | cut -d. -f3)" IPV4_ADDRESS1_PART4="$(echo ${IPV4_ADDRESS1} | cut -d. -f4)" + + IPV6_ADDRESS1="$(${DIG} AAAA +short ${NAME} | tail -n1)" fi sed -e "s|@NAME@|${NAME}|g" \ @@ -96,6 +98,7 @@ do -e "s|@IPV4_ADDRESS1_PART2@|${IPV4_ADDRESS1_PART2}|g" \ -e "s|@IPV4_ADDRESS1_PART3@|${IPV4_ADDRESS1_PART3}|g" \ -e "s|@IPV4_ADDRESS1_PART4@|${IPV4_ADDRESS1_PART4}|g" \ + -e "s|@IPV6_ADDRESS1@|${IPV6_ADDRESS1}|g" \ "${DEBCONF_PRESEED_FILE}" > "${DIRECTORY}/preseed.cfg" # Apply user specified preseed files -- cgit v1.2.3