diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-11-01 08:17:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-11-01 08:17:36 +0000 |
commit | a62718068b63b230ad1d038e124b15d3b7d1e22f (patch) | |
tree | a59e9dbb6a25913f82687152ec7a362b3cba73db /share/scripts/debconf | |
parent | Releasing debian version 20171013-1. (diff) | |
download | open-infrastructure-compute-tools-a62718068b63b230ad1d038e124b15d3b7d1e22f.tar.xz open-infrastructure-compute-tools-a62718068b63b230ad1d038e124b15d3b7d1e22f.zip |
Merging upstream version 20171101.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/scripts/debconf')
-rwxr-xr-x | share/scripts/debconf | 25 |
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" |