summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-02-18 14:31:16 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-02-18 15:05:47 +0000
commit9da9ea63869b9ea7b5834a9e9e45c65fea5c3475 (patch)
tree1fd43a0a50f5d15d1708566df3424bd76eb95eac
parentMaking container debconf create script aware of multiple subdirectories below... (diff)
downloadcompute-tools-9da9ea63869b9ea7b5834a9e9e45c65fea5c3475.tar.xz
compute-tools-9da9ea63869b9ea7b5834a9e9e45c65fea5c3475.zip
Making container debconf create script aware of multiple subdirectories below /etc/container-tools/debconf for automatically selecting an existing and matching debconf file.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-xshare/scripts/debconf.d/0001-preseed-file9
1 files changed, 9 insertions, 0 deletions
diff --git a/share/scripts/debconf.d/0001-preseed-file b/share/scripts/debconf.d/0001-preseed-file
index 804f328..02dd72d 100755
--- a/share/scripts/debconf.d/0001-preseed-file
+++ b/share/scripts/debconf.d/0001-preseed-file
@@ -38,6 +38,15 @@ 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 ]
+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
+
+ FILE="$(ls ${CONFIG}/*/${NAME}.cfg)"
+
+ db_set cnt-debconf/preseed-file "${FILE}"
+ db_fset cnt-debconf/preseed-file seen true
elif [ -e "${CONFIG}/default.cfg" ]
then
# user did not specify a pressed file, but there is a default one