summaryrefslogtreecommitdiffstats
path: root/share/scripts/debconf
diff options
context:
space:
mode:
Diffstat (limited to 'share/scripts/debconf')
-rwxr-xr-xshare/scripts/debconf17
1 files changed, 16 insertions, 1 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index 19e6e65..2edd543 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -618,7 +618,22 @@ 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_ADDRESS="$(${DIG} +short ${NAME} | tail -n1)"
+ fi
+
+ sed -e "s|@NAME@|${NAME}|g" \
+ -e "s|@IPV4_ADDRESS@|${IPV4_ADDRESS}|g" \
+ "${FILE}" >> "${DIRECTORY}/preseed.cfg"
done
Chroot "${DIRECTORY}" "debconf-set-selections preseed.cfg"