ubuntu1c-autoinstall/config/update_files.sh

23 lines
360 B
Bash
Raw Normal View History

2023-05-16 20:43:02 +00:00
#!/bin/bash
temp_yml() {
mktemp --suffix=.yml
}
gen_files() {
./gen_files_yml.sh >"$1"
}
update_files_from() {
SRC=$1 yq -i '.autoinstall.user-data.write_files |= load(strenv(SRC)).write_files' nocloud/user-data
}
pushd config >/dev/null 2>&1
TMP_YML=$(temp_yml)
gen_files "$TMP_YML"
update_files_from "$TMP_YML"
rm -f "$TMP_YML"
popd >/dev/null 2>&1