V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m54s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m54s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -41,4 +41,7 @@ check_nic() {
|
||||
do_log "info" "file_only" "1030() You have selected: '${var_nic}' - proceeding with setup."
|
||||
guard_dir && return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f check_nic
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -98,6 +98,9 @@ grub_extract_current_string() {
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f grub_extract_current_string
|
||||
|
||||
#######################################
|
||||
# Helper module to finish the modified GRUB CMDLINE strings.
|
||||
@@ -146,4 +149,7 @@ EOF
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f grub_finalize_string
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -28,6 +28,9 @@ chroot_logger() {
|
||||
chmod 0600 "${var_logfile}" || "${ERR_CHROOT_LOGGER}"
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f chroot_logger
|
||||
|
||||
#######################################
|
||||
# Helper Module to generate a Subnet Mask out of an IP in CCDIR Notation.
|
||||
@@ -50,6 +53,9 @@ generate_subnetmask() {
|
||||
printf '%s' "${var_has_ipv4_subnet}"
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f generate_subnetmask
|
||||
|
||||
#######################################
|
||||
# Collect NIC driver modules for initramfs installation (no lspci required).
|
||||
@@ -92,7 +98,9 @@ grep_nic_driver_modules() {
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f grep_nic_driver_modules
|
||||
|
||||
#######################################
|
||||
# Wrapper to insert the metadata field into the specified file.
|
||||
@@ -128,6 +136,9 @@ insert_comments() {
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f insert_comments
|
||||
|
||||
#######################################
|
||||
# Wrapper to insert the SPDX Header into the specified file.
|
||||
@@ -160,11 +171,18 @@ EOF
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f insert_header
|
||||
|
||||
#######################################
|
||||
# Helper module for update, full dist-upgrade, autoclean, autopurge and autoremove.
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
update_upgrade() {
|
||||
apt-get update
|
||||
@@ -172,5 +190,9 @@ update_upgrade() {
|
||||
apt-get autoclean -y
|
||||
apt-get autopurge -y
|
||||
apt-get autoremove -y
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f update_upgrade
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -22,6 +22,9 @@ remove_whitespace() {
|
||||
declare var_out=$(printf "%s" "$1" | xargs)
|
||||
printf '%s' "${var_out}"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f remove_whitespace
|
||||
|
||||
#######################################
|
||||
# Function to escape all shell metacharacters
|
||||
@@ -33,6 +36,9 @@ sanitize_input() {
|
||||
### %q quotes the string so that the shell re-reads it as the original literal
|
||||
printf '%q' "${input}"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f sanitize_input
|
||||
|
||||
#######################################
|
||||
# Function to remove any character not in the allowed set
|
||||
@@ -46,4 +52,7 @@ sanitize_string() {
|
||||
declare allowed='a-zA-Z0-9._/=\[\]:"\-+ '
|
||||
printf '%s' "${input}" | tr -cd "${allowed}"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f sanitize_string
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -42,6 +42,9 @@ scurl() {
|
||||
return "${ERR_DOWNLOAD_FAILED}"
|
||||
fi
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f scurl
|
||||
|
||||
#######################################
|
||||
# Wrapper for secure wget.
|
||||
@@ -73,4 +76,7 @@ swget() {
|
||||
return "${ERR_DOWNLOAD_FAILED}"
|
||||
fi
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f swget
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# yq_val <YQ expression> <file> - Returns value, converts null to ""
|
||||
# yq_val <YQ expression> <file> - Returns value, converts null to "".
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# 1: Key String to evaluate
|
||||
# 2: YAML File
|
||||
@@ -23,4 +25,7 @@ yq_val() {
|
||||
[[ "${var_h}" == null ]] && var_h=""
|
||||
printf '%s' "${var_h}"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f yq_val
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user