summaryrefslogtreecommitdiffstats
path: root/share/build-scripts/debconf.d/0002-preseed-debconf
diff options
context:
space:
mode:
Diffstat (limited to 'share/build-scripts/debconf.d/0002-preseed-debconf')
-rwxr-xr-xshare/build-scripts/debconf.d/0002-preseed-debconf8
1 files changed, 6 insertions, 2 deletions
diff --git a/share/build-scripts/debconf.d/0002-preseed-debconf b/share/build-scripts/debconf.d/0002-preseed-debconf
index 4bc4da6..3f1af64 100755
--- a/share/build-scripts/debconf.d/0002-preseed-debconf
+++ b/share/build-scripts/debconf.d/0002-preseed-debconf
@@ -83,21 +83,25 @@ do
if [ -n "${DIG}" ]
then
- IPV4_ADDRESS1="$(${DIG} A +short ${NAME} | tail -n1)"
+ IPV4_ADDRESS1_DNS="${IPV4_ADDRESS1_DNS:-${NAME}}"
+ IPV4_ADDRESS1="$(${DIG} A +short ${IPV4_ADDRESS1_DNS} | 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)"
+ IPV6_ADDRESS1_DNS="${IPV6_ADDRESS1_DNS:-${NAME}}"
+ IPV6_ADDRESS1="$(${DIG} AAAA +short ${IPV6_ADDRESS1_DNS} | tail -n1)"
fi
sed -e "s|@NAME@|${NAME}|g" \
+ -e "s|@IPV4_ADDRESS1_DNS@|${IPV4_ADDRESS1_DNS}|g" \
-e "s|@IPV4_ADDRESS1@|${IPV4_ADDRESS1}|g" \
-e "s|@IPV4_ADDRESS1_PART1@|${IPV4_ADDRESS1_PART1}|g" \
-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_DNS@|${IPV6_ADDRESS1_DNS}|g" \
-e "s|@IPV6_ADDRESS1@|${IPV6_ADDRESS1}|g" \
"${DEBCONF_PRESEED_FILE}" > "${DIRECTORY}/preseed.cfg"