summaryrefslogtreecommitdiffstats
path: root/share/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'share/scripts')
-rwxr-xr-xshare/scripts/debconf17
-rwxr-xr-xshare/scripts/debconf.d/0002-preseed-debconf17
2 files changed, 32 insertions, 2 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index 19e6e65..93cbda9 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_ADDRESS1="$(${DIG} +short ${NAME} | tail -n1)"
+ fi
+
+ sed -e "s|@NAME@|${NAME}|g" \
+ -e "s|@IPV4_ADDRESS1@|${IPV4_ADDRESS1}|g" \
+ "${FILE}" >> "${DIRECTORY}/preseed.cfg"
done
Chroot "${DIRECTORY}" "debconf-set-selections preseed.cfg"
diff --git a/share/scripts/debconf.d/0002-preseed-debconf b/share/scripts/debconf.d/0002-preseed-debconf
index 48fa6a1..2a3a33c 100755
--- a/share/scripts/debconf.d/0002-preseed-debconf
+++ b/share/scripts/debconf.d/0002-preseed-debconf
@@ -72,7 +72,22 @@ 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)"
+ fi
+
+ sed -e "s|@NAME@|${NAME}|g" \
+ -e "s|@IPV4_ADDRESS1@|${IPV4_ADDRESS1}|g" \
+ "${DEBCONF_PRESEED_FILE}" > "${DIRECTORY}/preseed.cfg"
# Apply user specified preseed files
debconf-set-selections "${DIRECTORY}/preseed.cfg"