Ensure defaults are always set

This commit is contained in:
2021-12-13 14:58:30 -05:00
parent a39f0d1aab
commit e18ad4c2e3
2 changed files with 26 additions and 1 deletions

View File

@ -133,9 +133,24 @@ seed_config() {
# Fetch the seed config
tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed
# Load the variables from the seed config
. /tmp/install.seed || exit 1
if [[ -n "${addpkglist}" ]]; then
# Ensure optional configurations are set to defaults if unset
if [[ -z ${filesystem} ]]; then
filesystem="${default_filesystem}"
fi
if [[ -z ${debrelease} ]]; then
debrelease="${default_debrelease}"
fi
if [[ -z ${debmirror} ]]; then
debmirror="${default_debmirror}"
fi
# Append the addpkglist to the suppkglist if present
if [[ -n ${addpkglist} ]]; then
suppkglist="${suppkglist},${addpkglist}"
fi