Ensure defaults are always set

This commit is contained in:
2023-09-01 15:41:58 -04:00
parent b18f1d85d6
commit efc152b6a6
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