V8.02.644.2025.05.31
All checks were successful
Retrieve the DNSSEC status at the time of updating the repository. / build-dnssec-diagram (push) Successful in 30s
All checks were successful
Retrieve the DNSSEC status at the time of updating the repository. / build-dnssec-diagram (push) Successful in 30s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -30,11 +30,11 @@
|
||||
# ERR_SPLASH_PNG
|
||||
# ERR_UNCRITICAL
|
||||
# ERR__SSH__PORT
|
||||
# HANDLER_ARCHITECTURE
|
||||
# handler_architecture
|
||||
# HANDLER_BUILD_DIR
|
||||
# HANDLER_CDI
|
||||
# HANDLER_DHCP
|
||||
# HANDLER_ISO_COUNTER
|
||||
# VAR_HANDLER_ISO_COUNTER
|
||||
# HANDLER_PRIORITY
|
||||
# HANDLER_SPLASH
|
||||
# HANDLER_SSHPORT
|
||||
@@ -44,16 +44,61 @@
|
||||
# ISO8601
|
||||
# REIONICE_CLASS
|
||||
# REIONICE_PRIORITY
|
||||
# VERSION
|
||||
# VAR_VERSION
|
||||
# handler_jumphost
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# description
|
||||
# Globals:
|
||||
# ARY_HANDLER_JUMPHOST
|
||||
# ARY_HANDLER_NETCUP_IPV6
|
||||
# ERR_ARG_MSMTCH
|
||||
# ERR_CONTROL_CT
|
||||
# ERR_MISS_PWD_F
|
||||
# ERR_MISS_PWD_P
|
||||
# ERR_OWNS_PWD_F
|
||||
# ERR_PASS_LENGH
|
||||
# ERR_PASS_PLICY
|
||||
# ERR_REIONICE_P
|
||||
# ERR_REIO_C_VAL
|
||||
# ERR_REIO_P_VAL
|
||||
# ERR_RENICE_PRI
|
||||
# ERR_RGHT_PWD_F
|
||||
# ERR_SPLASH_PNG
|
||||
# ERR_UNCRITICAL
|
||||
# ERR__SSH__PORT
|
||||
# VAR_ARCHITECTURE
|
||||
# VAR_BUILD_LOG
|
||||
# VAR_EARLY_DEBUG
|
||||
# VAR_HANDLER_BUILD_DIR
|
||||
# VAR_HANDLER_CDI
|
||||
# VAR_HANDLER_DHCP
|
||||
# VAR_HANDLER_ISO_COUNTER
|
||||
# VAR_HANDLER_NETCUP_IPV6
|
||||
# VAR_HANDLER_PRIORITY
|
||||
# VAR_HANDLER_SPLASH
|
||||
# VAR_HANDLER_STA
|
||||
# VAR_HASHED_PWD
|
||||
# VAR_ISO8601
|
||||
# VAR_REIONICE_CLASS
|
||||
# VAR_REIONICE_PRIORITY
|
||||
# VAR_SSHPORT
|
||||
# VAR_SSHPUBKEY
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
arg_parser() {
|
||||
while [[ $# -gt 0 ]]; do
|
||||
declare argument="${1}"
|
||||
case "${argument,,}" in
|
||||
|
||||
-a=* | --autobuild=*)
|
||||
shift 1
|
||||
;;
|
||||
|
||||
-c | --contact)
|
||||
if [[ -n "${2}" && "${2}" != -* ]]; then
|
||||
boot_screen_cleaner
|
||||
@@ -86,7 +131,7 @@ arg_parser() {
|
||||
|
||||
--architecture)
|
||||
if [[ "${2}" == "amd64" || "${2}" == "arm64" ]]; then
|
||||
declare -gx HANDLER_ARCHITECTURE="$2"
|
||||
declare -gx VAR_ARCHITECTURE="${2}"
|
||||
shift 2
|
||||
else
|
||||
boot_screen_cleaner
|
||||
@@ -98,8 +143,8 @@ arg_parser() {
|
||||
;;
|
||||
|
||||
--build-directory)
|
||||
declare -gx HANDLER_BUILD_DIR="${2}"
|
||||
declare -gx BUILD_LOG="${HANDLER_BUILD_DIR}/${ISO8601}_build.log"
|
||||
declare -gx VAR_HANDLER_BUILD_DIR="${2}"
|
||||
declare -gx VAR_BUILD_LOG="${VAR_HANDLER_BUILD_DIR}/${VAR_ISO8601}_build.log"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
@@ -110,13 +155,13 @@ arg_parser() {
|
||||
read -p -r $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_ARG_MSMTCH}"
|
||||
fi
|
||||
declare -g HANDLER_CDI=true
|
||||
declare -g VAR_HANDLER_CDI=true
|
||||
shift 1
|
||||
;;
|
||||
|
||||
--change-splash )
|
||||
if [[ "${2}" == "club" || "${2}" == "hexagon" ]]; then
|
||||
declare -g HANDLER_SPLASH="${2}"
|
||||
declare -g VAR_HANDLER_SPLASH="${2}"
|
||||
shift 2
|
||||
else
|
||||
boot_screen_cleaner
|
||||
@@ -129,7 +174,7 @@ arg_parser() {
|
||||
|
||||
--control)
|
||||
if [[ -n "${2}" && "${2}" =~ ^-?[0-9]+$ && "${2}" -ge 1 && "${2}" -le 65536 ]]; then
|
||||
declare -gi HANDLER_ISO_COUNTER="$2"
|
||||
declare -gi VAR_HANDLER_ISO_COUNTER="$2"
|
||||
shift 2
|
||||
else
|
||||
boot_screen_cleaner
|
||||
@@ -157,7 +202,7 @@ arg_parser() {
|
||||
read -p -r $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_ARG_MSMTCH}"
|
||||
fi
|
||||
declare -gi HANDLER_DHCP=1
|
||||
declare -gi VAR_HANDLER_DHCP=1
|
||||
shift 1
|
||||
;;
|
||||
|
||||
@@ -166,7 +211,7 @@ arg_parser() {
|
||||
declare -i count=0
|
||||
shift
|
||||
while [[ "${#}" -gt 0 && "${1}" != -* && count -lt 10 ]]; do
|
||||
declare -g handler_jumphost+=("$1")
|
||||
declare -g ARY_HANDLER_JUMPHOST+=("$1")
|
||||
count=$((count + 1))
|
||||
shift
|
||||
done
|
||||
@@ -188,18 +233,18 @@ arg_parser() {
|
||||
read -p -r $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_ARG_MSMTCH}"
|
||||
fi
|
||||
declare -gi HANDLER_STA=1
|
||||
declare -gi VAR_HANDLER_STA=1
|
||||
shift 1
|
||||
;;
|
||||
|
||||
--provider-netcup-ipv6)
|
||||
if [[ -n "${2}" && "${2}" != -* ]]; then
|
||||
declare -i count=0
|
||||
declare -g handler_netcup_ipv6=true
|
||||
declare -g VAR_HANDLER_NETCUP_IPV6=true
|
||||
shift
|
||||
while [[ "${#}" -gt 0 && "${1}" != -* && count -lt 1 ]]; do
|
||||
declare cleaned="${1//[\[\]]/}"
|
||||
declare -g handler_netcup_ipv6_array+=("${cleaned}")
|
||||
declare -g ARY_HANDLER_NETCUP_IPV6+=("${cleaned}")
|
||||
count=$((count + 1))
|
||||
shift
|
||||
done
|
||||
@@ -216,7 +261,7 @@ arg_parser() {
|
||||
|
||||
--renice-priority)
|
||||
if [[ -n ${2} && ${2} =~ ^-?[0-9]+$ && ${2} -ge -19 && ${2} -le 19 ]]; then
|
||||
declare -gi HANDLER_PRIORITY="$2"
|
||||
declare -gi VAR_HANDLER_PRIORITY="$2"
|
||||
shift 2
|
||||
else
|
||||
boot_screen_cleaner
|
||||
@@ -235,12 +280,12 @@ arg_parser() {
|
||||
exit "${ERR_REIONICE_P}"
|
||||
else
|
||||
if [[ "${2}" =~ ^[1-3]$ ]]; then
|
||||
declare -gi REIONICE_CLASS="${2}"
|
||||
declare -gi VAR_REIONICE_CLASS="${2}"
|
||||
if [[ -z "${3}" ]]; then
|
||||
:
|
||||
else
|
||||
if [[ "${3}" =~ ^[0-7]$ ]]; then
|
||||
declare -gi REIONICE_PRIORITY="${3}"
|
||||
declare -gi VAR_REIONICE_PRIORITY="${3}"
|
||||
else
|
||||
boot_screen_cleaner
|
||||
printf "\e[91m❌ Error: --reionice-priority PRIORITY MUST be an integer between '0' and '7'.\e[0m\n" >&2
|
||||
@@ -255,7 +300,7 @@ arg_parser() {
|
||||
exit "${ERR_REIO_C_VAL}"
|
||||
fi
|
||||
fi
|
||||
if [[ -n ${REIONICE_PRIORITY} ]]; then
|
||||
if [[ -n ${VAR_REIONICE_PRIORITY} ]]; then
|
||||
shift 3
|
||||
else
|
||||
shift 2
|
||||
@@ -305,11 +350,11 @@ arg_parser() {
|
||||
fi
|
||||
|
||||
declare plaintext_pw
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
if ! IFS= read -r plaintext_pw < "${pw_file}"; then
|
||||
:
|
||||
fi
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
declare pw_length
|
||||
pw_length=${#plaintext_pw}
|
||||
@@ -321,16 +366,16 @@ arg_parser() {
|
||||
exit "${ERR_PASS_LENGH}"
|
||||
fi
|
||||
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
if [[ "${plaintext_pw}" == *\"* ]]; then
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
boot_screen_cleaner
|
||||
printf "\e[91m❌ Error: --root-password-file password MUST NOT contain double quotes (\").\e[0m\n" >&2
|
||||
# shellcheck disable=SC2162
|
||||
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_PASS_PLICY}"
|
||||
fi
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
declare salt
|
||||
set +o pipefail
|
||||
@@ -341,11 +386,11 @@ arg_parser() {
|
||||
set -o pipefail
|
||||
|
||||
declare hash_temp
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
hash_temp=$(mkpasswd --method=sha-512 --salt="${salt}" --rounds=8388608 "${plaintext_pw}")
|
||||
[[ "${EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
declare -g HASHED_PWD="${hash_temp}"
|
||||
declare -g VAR_HASHED_PWD="${hash_temp}"
|
||||
unset hash_temp plaintext_pw
|
||||
|
||||
sync
|
||||
@@ -361,7 +406,7 @@ arg_parser() {
|
||||
|
||||
--ssh-port)
|
||||
if [[ -n "${2}" && "${2}" =~ ^-?[0-9]+$ && "${2}" -ge 1 && "${2}" -le 65535 ]]; then
|
||||
declare -gi HANDLER_SSHPORT="${2}"
|
||||
declare -gi VAR_SSHPORT="${2}"
|
||||
shift 2
|
||||
else
|
||||
boot_screen_cleaner
|
||||
@@ -372,7 +417,7 @@ arg_parser() {
|
||||
;;
|
||||
|
||||
--ssh-pubkey)
|
||||
declare -g HANDLER_SSHPUBKEY="${2}"
|
||||
declare -g VAR_SSHPUBKEY="${2}"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user