V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 43s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-07-29 19:09:53 +02:00
parent bd38d43bcf
commit 62b2d29610
2 changed files with 6 additions and 17 deletions

View File

@@ -61,24 +61,14 @@ yaml_parser() {
done < <(compgen -v)
### Delete the respective 'key:value'-variables in the global variable set.
### Substitute all key= by key=""
### Wrap each key=value by '' e.g., key='value'
awk '
/^grub_parameter_[0-9]+=|^ntp_server_[0-9]+=|^software_[0-9]+=/ { next }
/=\s*$/ { sub(/=\s*$/, "=\"\"") }
!/'"'"'/ && /=/ { sub(/=([^'\''\"]+)$/, "='\''\\1'\''") }
{ print }
' "${VAR_PRESEED}" >| "${VAR_PRESEED}.tmp" && mv -- "${VAR_PRESEED}.tmp" "${VAR_PRESEED}"
### Delete the respective 'key:value'-variables in the global variable set.
#sed -i '/^grub_parameter_[0-9]\+=/d' "${VAR_PRESEED}"
#sed -i '/^ntp_server_[0-9]\+=/d' "${VAR_PRESEED}"
#sed -i '/^software_[0-9]\+=/d' "${VAR_PRESEED}"
sed -i '/^grub_parameter_[0-9]\+=/d' "${VAR_PRESEED}"
sed -i '/^ntp_server_[0-9]\+=/d' "${VAR_PRESEED}"
sed -i '/^software_[0-9]\+=/d' "${VAR_PRESEED}"
### Substitute all key= by key=""
#sed -i -E 's/^(.*)=\s*$/\1=""/' "${VAR_PRESEED}"
sed -i -E 's/^(.*)=\s*$/\1=""/' "${VAR_PRESEED}"
### Wrap each key=value by '' e.g., key='value'
#sed -i -E "s/^(.*)=([^'\"]+)$/\1='\2'/" "${VAR_PRESEED}"
sed -i -E "s/^(.*)=([^'\"]+)$/\1='\2'/" "${VAR_PRESEED}"
# shellcheck disable=SC1090
. "${VAR_PRESEED}"