V8.00.000.2025.06.17
Some checks failed
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Failing after 33s
Some checks failed
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Failing after 33s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -35,7 +35,7 @@ yaml_parser() {
|
|||||||
### Declare Arrays, HashMaps, and Variables.
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
declare -ag ARY_ALLOW_IPV4=() ARY_ALLOW_IPV6=() 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 -gix VAR_USER_MAX=-1
|
||||||
declare var_index="" var_key="" var_value=""
|
declare var_index="" var_key="" var_value=""
|
||||||
|
|
||||||
cat "${DIR_CNF}/preseed.yaml" "${DIR_CNF}/partitioning.yaml" >| "${DIR_TMP}/combined.yaml"
|
cat "${DIR_CNF}/preseed.yaml" "${DIR_CNF}/partitioning.yaml" >| "${DIR_TMP}/combined.yaml"
|
||||||
@@ -59,15 +59,19 @@ yaml_parser() {
|
|||||||
|
|
||||||
### Search all set variables for user_userN_name patterns.
|
### Search all set variables for user_userN_name patterns.
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
while IFS='=' read -r var_index; do
|
while IFS= read -r v; do
|
||||||
if [[ "${var_index}" =~ ^user_user([0-9]+)_name$ ]]; then
|
### Accept any of these keys: name, fullname, uid, gid, shell, password, sshpubkey, authentication_* and privileges_*
|
||||||
var_index="${BASH_REMATCH[1]}"
|
if [[ "${v}" =~ ^user_user([0-9]+)_(name|fullname|uid|gid|shell|password|sshpubkey|authentication_[A-Za-z0-9_]+|privileges_[A-Za-z0-9_]+)$ ]]; then
|
||||||
(( var_index > VAR_USER_MAX )) && VAR_USER_MAX="${var_index}"
|
var_index=${BASH_REMATCH[1]}
|
||||||
|
(( var_index > VAR_USER_MAX )) && VAR_USER_MAX=var_index
|
||||||
fi
|
fi
|
||||||
done < <(compgen -v)
|
done < <(compgen -A variable user_user)
|
||||||
|
|
||||||
|
### If nothing matched, default to 0 (only user 0).
|
||||||
|
(( VAR_USER_MAX < 0 )) && VAR_USER_MAX=0
|
||||||
do_log "info" "file_only" "1250() Found highest User #: '${VAR_USER_MAX}'."
|
do_log "info" "file_only" "1250() Found highest User #: '${VAR_USER_MAX}'."
|
||||||
|
|
||||||
### Remove obsolete variables, normalize empty assignments, wrap remaining values in single quotes
|
### Remove obsolete variables, normalize empty assignments, wrap remaining values in single quotes.
|
||||||
sed -i -E '
|
sed -i -E '
|
||||||
# --- Deletions --------------------------------------------------------
|
# --- Deletions --------------------------------------------------------
|
||||||
/^grub_parameter_[0-9]+=/d # delete grub parameter variables
|
/^grub_parameter_[0-9]+=/d # delete grub parameter variables
|
||||||
|
|||||||
Reference in New Issue
Block a user