Rename latest_deployment_always_default to latest_image_always_default

This commit is contained in:
Dennis ten Hoove 2024-03-05 11:12:53 +01:00
parent 2a4215a8e1
commit 7fffd07d3a

10
arkdep
View file

@ -82,7 +82,7 @@ if [[ ! $1 == 'init' ]]; then
[[ -z ${minimum_available_root_storage+x} ]] && minimum_available_root_storage=12582912 && printf '\e[1;33m<!>\e[0m\e[1m minimum_available_root_storage not defined in config, using default\e[0m\n'
[[ -z ${update_cpu_microcode+x} ]] && update_cpu_microcode=1 && printf '\e[1;33m<!>\e[0m\e[1m update_cpu_microcode not defined in config, using default\e[0m\n'
[[ -z ${backup_user_accounts+x} ]] && backup_user_accounts=0 && printf '\e[1;33m<!>\e[0m\e[1m backup_user_accounts not defined in config, using default\e[0m\n'
[[ -z ${latest_deployment_always_default+x} ]] && latest_deployment_always_default=0 && printf '\e[1;33m<!>\e[0m\e[1m latest_deployment_always_default not defined in config, using default\e[0m\n'
[[ -z ${latest_image_always_default+x} ]] && latest_image_always_default=0 && printf '\e[1;33m<!>\e[0m\e[1m latest_image_always_default not defined in config, using default\e[0m\n'
fi
## Common functions
@ -299,8 +299,8 @@ init () {
# Automatically make a copy of passwd, shadow and group files if they differ from overlay
backup_user_accounts=0
# Ensure latest deployment is always the default systemd-boot boot entry
latest_deployment_always_default=0
# Ensure latest image as defined in the external database is always the default systemd-boot boot entry
latest_image_always_default=0
END
# Add default bootloader config file
@ -543,9 +543,9 @@ deploy () {
if [[ -e $arkdep_dir/deployments/${data[0]} ]]; then
# Lets ensure the latest deployment is active, even if it is already deployed
if [[ latest_deployment_always_default -eq 1 ]] && [[ ! $ARKDEP_NO_BOOTCTL -eq 1 ]]; then
if [[ latest_image_always_default -eq 1 ]] && [[ ! $ARKDEP_NO_BOOTCTL -eq 1 ]]; then
# Allow it to error, it is no big deal if it does
bootctl set-default ${data[0]}.conf || printf '\e[1;33m<!>\e[0m\e[1m Failed to set default bootloader entry on latest_deployment_always_default\e[0m\n'
bootctl set-default ${data[0]}.conf || printf '\e[1;33m<!>\e[0m\e[1m Failed to set default bootloader entry on latest_image_always_default\e[0m\n'
fi
printf "\e[1;33m<!>\e[0m\e[1m ${data[0]} is already deployed, canceling deployment\e[0m\n"