V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 56s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 56s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -15,6 +15,8 @@ guard_sourcing
|
||||
#######################################
|
||||
# Parsing './.preseed/preseed.yaml' and './.preseed/partitioning.yaml'.
|
||||
# Globals:
|
||||
# ARY_ALLOW_IPV4
|
||||
# ARY_ALLOW_IPV6
|
||||
# ARY_BOOTPARAM
|
||||
# ARY_LOCALE
|
||||
# ARY_NTPSRVR
|
||||
@@ -32,7 +34,7 @@ guard_sourcing
|
||||
yaml_parser() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
# shellcheck disable=SC2034
|
||||
declare -ag ARY_BOOTPARAM=() ARY_LOCALE=() ARY_NTPSRVR=() ARY_PACKAGES=()
|
||||
declare -ag ARY_ALLOW_IPV4=() ARY_ALLOW_IPV6=() ARY_BOOTPARAM=() ARY_LOCALE=() ARY_NTPSRVR=() ARY_PACKAGES=()
|
||||
declare -gix VAR_USER_MAX=0
|
||||
declare var_index="" var_key="" var_value=""
|
||||
|
||||
@@ -46,10 +48,12 @@ yaml_parser() {
|
||||
var_value=${var_value%\'}
|
||||
# shellcheck disable=SC2034
|
||||
case "${var_key}" in
|
||||
grub_parameter_[0-9]*) ARY_BOOTPARAM+=("${var_value}") ;;
|
||||
locale_locale_[0-9]*) ARY_LOCALE+=("${var_value}") ;;
|
||||
ntp_server_[0-9]*) ARY_NTPSRVR+=("${var_value}") ;;
|
||||
software_[0-9]*) ARY_PACKAGES+=("${var_value}") ;;
|
||||
grub_parameter_[0-9]*) ARY_BOOTPARAM+=("${var_value}") ;;
|
||||
locale_locale_[0-9]*) ARY_LOCALE+=("${var_value}") ;;
|
||||
ntp_server_[0-9]*) ARY_NTPSRVR+=("${var_value}") ;;
|
||||
ssh_allow_ipv4_[0-9]*) ARY_ALLOW_IPV4+=("${var_value}") ;;
|
||||
ssh_allow_ipv6_[0-9]*) ARY_ALLOW_IPV6+=("${var_value}") ;;
|
||||
software_[0-9]*) ARY_PACKAGES+=("${var_value}") ;;
|
||||
esac
|
||||
done < "${VAR_PRESEED}"
|
||||
|
||||
@@ -68,6 +72,8 @@ yaml_parser() {
|
||||
/^grub_parameter_[0-9]+=/d # delete grub parameter variables
|
||||
/^locale_locale_[0-9]+=/d # delete locale variables
|
||||
/^ntp_server_[0-9]+=/d # delete NTP server variables
|
||||
/^ssh_allow_ipv4_[0-9]+=/d # delete ssh allow IPv4 variables
|
||||
/^ssh_allow_ipv6_[0-9]+=/d # delete ssh allow IPv6 variables
|
||||
/^software_[0-9]+=/d # delete software list variables
|
||||
|
||||
# --- Empty-value normalisation ---------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user