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

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-09-04 08:38:56 +02:00
parent 89f2b46eb8
commit 8c2f496f88
2 changed files with 12 additions and 5 deletions

View File

@@ -11,7 +11,12 @@
# SPDX-Security-Contact: security@coresecret.eu
# SPDX-Comment: unlock_wrapper.sh to be executed as '/etc/crypttab' keyscript and as dropbear SSH forced command.
set -Ceuo pipefail
set -Ceu -o pipefail -o ignoreeof
shopt -s failglob
shopt -s lastpipe
shopt -u nullglob
umask 0077
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr"
#######################################
# Variable declaration
@@ -265,7 +270,7 @@ read_passphrase() {
### Read from SSH STDIN (or TTY fallback), never via '/lib/cryptsetup/askpass'.
ask_via_stdin "Enter passphrase: " PASSPHRASE
### NUKE pre-check
### NUKE pre-check.
if [[ "${NUKE_ENABLED,,}" == "true" ]]; then
ROUNDS="$(cut -d'$' -f3 <<< "${NUKE_HASH}")"
@@ -275,8 +280,6 @@ read_passphrase() {
if [[ "${CAND}" == "${NUKE_HASH}" ]]; then
echo "${CAND}" "==" "${NUKE_HASH}"
nuke
fi
@@ -330,6 +333,7 @@ trap_on_term() {
stty echo
printf "%s" "${NL}"
color_echo "${RED}" "✘ Received termination signal. System Power Off in 3 seconds." >&2
# TODO: REMOVE DEBUGGER FOR PRODUCTION
drop_bash
#power_off 3
}
@@ -344,6 +348,7 @@ trap_on_term() {
# 0: Script Name
#######################################
verify_script() {
# TODO: TEST THIS FUNC()
declare dir
# shellcheck disable=SC2312
dir="$(dirname "$(readlink -f "${0}")")"