[arkdep] Implement ARKDEP_CONFIG

This commit is contained in:
Dennis ten Hoove 2024-08-23 17:39:43 +02:00
parent 784ef43198
commit a971b605b0
No known key found for this signature in database
GPG key ID: 2BA91DC2563B83D1
2 changed files with 17 additions and 1 deletions

16
arkdep
View file

@ -40,7 +40,21 @@ fi
## Load config file, unless we are running init
#
if [[ ! $1 == 'init' ]]; then
source $arkdep_dir/config
if [[ -z ${ARKDEP_CONFIG+x} ]]; then
# Ensure file exists
if [[ ! -f $arkdep_dir/config ]]; then
printf "\e[1;31m<#>\e[0m\e[1m $arkdep_dir/config configuration file does not exist\e[0m\n"
exit 1
fi
source $arkdep_dir/config
else
# Ensure file exists
if [[ ! -f $ARKDEP_CONFIG ]]; then
printf "\e[1;31m<#>\e[0m\e[1m $ARKDEP_CONFIG configuration file does not exist\e[0m\n"
exit 1
fi
source $ARKDEP_CONFIG
fi
# Set default variables if config variables are undefined
[[ -z ${enable_overlay+x} ]] && enable_overlay=1 && printf '\e[1;33m<!>\e[0m\e[1m enable_overlay not defined in config, using default\e[0m\n'

View file

@ -35,6 +35,8 @@ Set custom /boot location, overwrites ARKDEP_ROOT on relevant tasks if set, impl
Do not run bootctl commands, this includes installing systemd-boot and setting the new deployment as the default boot entry.
.SS ARKDEP_CONFIRM
Skip interactive prompts.
.SS ARKDEP_CONFIG
Override configuration file location.
.SH EXAMPLES
.SS arkdep deploy
Check for updates, if available download and deploy.