From a38799da244b3f9ec3bfa6ad4c2261dec0ceaee4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 11 Jan 2019 10:50:28 +0100 Subject: FIXME Signed-off-by: Daniel Baumann --- share/scripts/debconf.d/0001-preseed-file | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/share/scripts/debconf.d/0001-preseed-file b/share/scripts/debconf.d/0001-preseed-file index 021dabf..281430a 100755 --- a/share/scripts/debconf.d/0001-preseed-file +++ b/share/scripts/debconf.d/0001-preseed-file @@ -38,11 +38,20 @@ then # available on the system matching the container name db_set cnt-debconf/preseed-file "${CONFIG}/${NAME}.cfg" db_fset cnt-debconf/preseed-file seen true -elif [ "$(ls ${CONFIG}/*/${NAME}.cfg 2>/dev/null | wc -l)" -eq 1 ] +elif ls ${CONFIG}/*/${NAME}.cfg > /dev/null 2>&1 then # user did not specify a pressed file, but there is 1 (and only 1) # matching in a sub-directory of /etc/container-tools/debconf + if [ "$(ls ${CONFIG}/*/${NAME}.cfg 2>/dev/null | wc -l)" -gt 1 ] + then + echo "'${NAME}': not unique, showing debconf selection" + + +elif [ "$(ls ${CONFIG}/*/${NAME}.cfg 2>/dev/null | wc -l)" -eq 1 ] + # user did not specify a pressed file, but there is 1 (and only 1) + # matching in a sub-directory of /etc/container-tools/debconf + FILE="$(ls ${CONFIG}/*/${NAME}.cfg)" db_set cnt-debconf/preseed-file "${FILE}" -- cgit v1.2.3