summaryrefslogtreecommitdiffstats
path: root/share/scripts/debconf.d/0002-preseed-debconf
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-11-01 08:16:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-11-01 08:16:57 +0000
commit34095d718ea653678e29bd60ac32740c13df3417 (patch)
treeab8a557980a133ff8b40ce3d53a2984dc5db04c3 /share/scripts/debconf.d/0002-preseed-debconf
parentAdding upstream version 20171013. (diff)
downloadopen-infrastructure-compute-tools-34095d718ea653678e29bd60ac32740c13df3417.tar.xz
open-infrastructure-compute-tools-34095d718ea653678e29bd60ac32740c13df3417.zip
Adding upstream version 20171101.upstream/20171101
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/scripts/debconf.d/0002-preseed-debconf')
-rwxr-xr-xshare/scripts/debconf.d/0002-preseed-debconf25
1 files changed, 24 insertions, 1 deletions
diff --git a/share/scripts/debconf.d/0002-preseed-debconf b/share/scripts/debconf.d/0002-preseed-debconf
index 48fa6a1..d46121c 100755
--- a/share/scripts/debconf.d/0002-preseed-debconf
+++ b/share/scripts/debconf.d/0002-preseed-debconf
@@ -72,7 +72,30 @@ done
for DEBCONF_PRESEED_FILE in ${DEBCONF_PRESEED_FILES}
do
- sed -e "s|@NAME@|${NAME}|g" "${DEBCONF_PRESEED_FILE}" > "${DIRECTORY}/preseed.cfg"
+ if [ -e /usr/bin/kdig ]
+ then
+ DIG="/usr/bin/kdig"
+ elif [ -e /usr/bin/dig ]
+ then
+ DIG="/usr/bin/dig"
+ fi
+
+ if [ -n "${DIG}" ]
+ then
+ IPV4_ADDRESS1="$(${DIG} +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)"
+ fi
+
+ sed -e "s|@NAME@|${NAME}|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" \
+ "${DEBCONF_PRESEED_FILE}" > "${DIRECTORY}/preseed.cfg"
# Apply user specified preseed files
debconf-set-selections "${DIRECTORY}/preseed.cfg"