V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m0s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m0s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
31
lib/cdi_0010_basic/0010_color_echo.sh
Normal file
31
lib/cdi_0010_basic/0010_color_echo.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Print-colored text.
|
||||
# Globals:
|
||||
# NL
|
||||
# RES
|
||||
# WHI
|
||||
# Arguments:
|
||||
# 1: Color code.
|
||||
# *: Text to print.
|
||||
#######################################
|
||||
color_echo() {
|
||||
declare c="$1"
|
||||
shift
|
||||
declare msg="${*}"
|
||||
printf "%b[INFO]%b %b%s %b%b" "${c}" "${RES}" "${WHI}" "${msg}" "${RES}" "${NL}"
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
60
lib/cdi_0010_basic/0011_gen_dir_files.sh
Normal file
60
lib/cdi_0010_basic/0011_gen_dir_files.sh
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Creates the DIRs, prepares the files and mounting paths for installation.
|
||||
# Globals:
|
||||
# DIR_LOG
|
||||
# LOG_DBS
|
||||
# LOG_ERR
|
||||
# LOG_INS
|
||||
# LOG_NIC
|
||||
# LOG_UID
|
||||
# RECOVERY
|
||||
# TARGET
|
||||
# VAR_PRESEED
|
||||
# VAR_SAFE_MNT_BASE
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
gen_dir_files() {
|
||||
[[ -d /tmp/.ciss/log ]] && rm -rf /tmp/.ciss
|
||||
[[ -d "${TARGET}" ]] && rm -rf "${TARGET}"
|
||||
[[ -d "${RECOVERY}" ]] && rm -rf "${RECOVERY}"
|
||||
[[ -d "${VAR_SAFE_MNT_BASE}" ]] && rm -rf "${VAR_SAFE_MNT_BASE}"
|
||||
|
||||
### MAKE DIRS
|
||||
mkdir -p /tmp/.ciss/{backup,log,tmp} && chmod -R 0700 /tmp/.ciss
|
||||
mkdir -p "${TARGET}"
|
||||
mkdir -p "${RECOVERY}"
|
||||
mkdir -p "${VAR_SAFE_MNT_BASE}"
|
||||
|
||||
### TOUCH FILES
|
||||
touch "${LOG_ERR}" && chmod 0600 "${LOG_ERR}"
|
||||
touch "${LOG_EXT}" && chmod 0600 "${LOG_EXT}"
|
||||
touch "${LOG_INS}" && chmod 0600 "${LOG_INS}"
|
||||
touch "${LOG_NIC}" && chmod 0600 "${LOG_NIC}"
|
||||
touch "${LOG_UID}" && chmod 0600 "${LOG_UID}"
|
||||
touch "${LOG_DBS}" && chmod 0600 "${LOG_DBS}"
|
||||
touch "${VAR_PRESEED}" && chmod 0600 "${VAR_PRESEED}"
|
||||
touch "${DIR_LOG}/btrfs.log" && chmod 0600 "${DIR_LOG}/btrfs.log"
|
||||
touch "${DIR_LOG}/cpu.log" && chmod 0600 "${DIR_LOG}/cpu.log"
|
||||
touch "${DIR_LOG}/ext4.log" && chmod 0600 "${DIR_LOG}/ext4.log"
|
||||
touch "${DIR_LOG}/sshd_config.log" && chmod 0600 "${DIR_LOG}/sshd_config.log"
|
||||
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
36
lib/cdi_0010_basic/0012_calculate_runtime.sh
Normal file
36
lib/cdi_0010_basic/0012_calculate_runtime.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Calculates total runtime of the CISS.debian.installer.
|
||||
# Globals:
|
||||
# VAR_END_TIME
|
||||
# VAR_SCRIPT_RUNTIME
|
||||
# VAR_START_TIME
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
calculate_runtime() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare -i var_runtime="${SECONDS}"
|
||||
declare -i var_hours=$(( var_runtime / 3600 ))
|
||||
declare -i var_minutes=$(( (var_runtime % 3600) / 60 ))
|
||||
declare -i var_seconds=$(( var_runtime % 60 ))
|
||||
# shellcheck disable=SC2155
|
||||
declare -grx VAR_SCRIPT_RUNTIME="$(printf "%02dh %02dm %02ds" "${var_hours}" "${var_minutes}" "${var_seconds}")"
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
Reference in New Issue
Block a user