V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 43s
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:
@@ -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}"
|
||||
|
||||
@@ -173,8 +173,7 @@ trap_exit_non_zero() {
|
||||
printf "%b❌ Arguments Counter : %s %b%b" "${RED}" "${VAR_PARAM_COUNT}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ Arguments Original : %s %b%b" "${RED}" "${VAR_PARAM_STRNG}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ Arguments Sanitized : %s %b%b" "${RED}" "${VAR_ARG_SANITIZED}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ BASHOPTS : %b%b " "${RED}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌%24s%s %b%b" "${RED}" "" "${BASHOPTS}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ BASHOPTS : %s %b%b" "${RED}" "${BASHOPTS}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ SHELLOPTS : %s %b%b" "${RED}" "${SHELLOPTS}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ Error Log saved at : %s %b%b" "${RED}" "${LOG_EXT}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
printf "%b❌ cat %s %b%b" "${RED}" "${LOG_EXT}" "${RES}" "${NL}" | tee -a "${LOG_EXT}"
|
||||
|
||||
Reference in New Issue
Block a user