From f1ac6bd6b88e9c8140d19e60fac0f3b3651c56dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 26 May 2016 11:45:46 +0200 Subject: Adding auto option to set automatic start in debconf script. Signed-off-by: Daniel Baumann --- share/scripts/debconf | 1 + share/scripts/debconf.d/0003-debconf | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'share/scripts') diff --git a/share/scripts/debconf b/share/scripts/debconf index 0c952e8..4f29238 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -907,6 +907,7 @@ Commands () HOSTNAME_SHORT="$(echo ${NAME} | cut -c-8)" HOST_INTERFACE_NAME="$(echo ${NETWORK0_VETH:-veth-${HOSTNAME_SHORT}-0})" + sed -i -e "s|^cnt.auto=.*|cnt.auto=${CNT_AUTO}|" "${CONFIG}/${NAME}.conf" sed -i -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK0_BRIDGE:-br0}|g" "${CONFIG}/${NAME}.conf" sed -i -e "s|^bind=.*|bind=${BIND}|" "${CONFIG}/${NAME}.conf" sed -i -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf" diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf index a1cab20..baf6879 100755 --- a/share/scripts/debconf.d/0003-debconf +++ b/share/scripts/debconf.d/0003-debconf @@ -1042,6 +1042,19 @@ Internal_options () echo "HOST_COMMAND=\"${HOST_COMMAND}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + if db_get cnt-debconf/auto + then + CNT_AUTO="${RET:-FQDN}" # string (w/o empty) + + case "${CNT_AUTO}" in + FQDN) + CNT_AUTO="$(hostname -f)" + ;; + esac + fi + + echo "CNT_AUTO=\"${CNT_AUTO}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + if db_get cnt-debconf/bind then BIND="${RET}" # string (w/ empty) -- cgit v1.2.3