V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m1s
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:
@@ -11,7 +11,12 @@
|
|||||||
# SPDX-Security-Contact: security@coresecret.eu
|
# SPDX-Security-Contact: security@coresecret.eu
|
||||||
# SPDX-Comment: unlock_wrapper.sh to be executed as '/etc/crypttab' keyscript and as dropbear SSH forced command.
|
# 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
|
# Variable declaration
|
||||||
@@ -265,7 +270,7 @@ read_passphrase() {
|
|||||||
### Read from SSH STDIN (or TTY fallback), never via '/lib/cryptsetup/askpass'.
|
### Read from SSH STDIN (or TTY fallback), never via '/lib/cryptsetup/askpass'.
|
||||||
ask_via_stdin "Enter passphrase: " PASSPHRASE
|
ask_via_stdin "Enter passphrase: " PASSPHRASE
|
||||||
|
|
||||||
### NUKE pre-check
|
### NUKE pre-check.
|
||||||
if [[ "${NUKE_ENABLED,,}" == "true" ]]; then
|
if [[ "${NUKE_ENABLED,,}" == "true" ]]; then
|
||||||
|
|
||||||
ROUNDS="$(cut -d'$' -f3 <<< "${NUKE_HASH}")"
|
ROUNDS="$(cut -d'$' -f3 <<< "${NUKE_HASH}")"
|
||||||
@@ -275,8 +280,6 @@ read_passphrase() {
|
|||||||
|
|
||||||
if [[ "${CAND}" == "${NUKE_HASH}" ]]; then
|
if [[ "${CAND}" == "${NUKE_HASH}" ]]; then
|
||||||
|
|
||||||
echo "${CAND}" "==" "${NUKE_HASH}"
|
|
||||||
|
|
||||||
nuke
|
nuke
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -330,6 +333,7 @@ trap_on_term() {
|
|||||||
stty echo
|
stty echo
|
||||||
printf "%s" "${NL}"
|
printf "%s" "${NL}"
|
||||||
color_echo "${RED}" "✘ Received termination signal. System Power Off in 3 seconds." >&2
|
color_echo "${RED}" "✘ Received termination signal. System Power Off in 3 seconds." >&2
|
||||||
|
# TODO: REMOVE DEBUGGER FOR PRODUCTION
|
||||||
drop_bash
|
drop_bash
|
||||||
#power_off 3
|
#power_off 3
|
||||||
}
|
}
|
||||||
@@ -344,6 +348,7 @@ trap_on_term() {
|
|||||||
# 0: Script Name
|
# 0: Script Name
|
||||||
#######################################
|
#######################################
|
||||||
verify_script() {
|
verify_script() {
|
||||||
|
# TODO: TEST THIS FUNC()
|
||||||
declare dir
|
declare dir
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
dir="$(dirname "$(readlink -f "${0}")")"
|
dir="$(dirname "$(readlink -f "${0}")")"
|
||||||
|
|||||||
@@ -19,9 +19,11 @@ case "${1}" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
mkdir -p /run/ciss
|
mkdir -p /run/ciss
|
||||||
printf '%s\n' "${PATH}" >| /run/ciss/fixpath.initial
|
printf '%s\n' "${PATH}" >| /run/ciss/fixpath_early.initial
|
||||||
|
|
||||||
### Make sure /usr/local/bin is in front of 'PATH'.
|
### Make sure /usr/local/bin is in front of 'PATH'.
|
||||||
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr"
|
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr"
|
||||||
|
|
||||||
|
printf '%s\n' "${PATH}" >| /run/ciss/fixpath_late.initial
|
||||||
|
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
|
|||||||
Reference in New Issue
Block a user