summaryrefslogtreecommitdiffstats
path: root/share/scripts/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
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')
-rwxr-xr-xshare/scripts/debconf25
1 files changed, 24 insertions, 1 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index 19e6e65..3bc3b43 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -618,7 +618,30 @@ EOF
then
for FILE in ${PRESEED_FILE}
do
- sed -e "s|@NAME@|${NAME}|g" "${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" \
+ "${FILE}" >> "${DIRECTORY}/preseed.cfg"
done
Chroot "${DIRECTORY}" "debconf-set-selections preseed.cfg"