V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m57s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m57s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -28,15 +28,35 @@
|
||||
|
||||
### PRELIMINARY CHECKS
|
||||
[ -z "${BASH_VERSINFO[0]}" ] && {
|
||||
. ./var/errors.var.sh; printf "\e[91m❌ Please make sure you are using 'bash'! Bye... \e[0m\n" >&2; exit "${ERR_UNSUPPORTED_BASH}"; }
|
||||
. ./meta_loader_early.sh
|
||||
printf "%s❌ Please make sure you are using 'bash'! Bye... %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
[[ ${EUID} -ne 0 ]] && {
|
||||
. ./var/errors.var.sh; printf "\e[91m❌ Please make sure you are 'root'! Bye... \e[0m\n" >&2; exit "${ERR_USER_IS_NOT_ROOT}"; }
|
||||
. ./meta_loader_early.sh
|
||||
printf "%s❌ Please make sure you are 'root'! Bye... %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_USER_IS_NOT_ROOT}"
|
||||
}
|
||||
|
||||
[[ $(kill -l | grep -c SIG) -eq 0 ]] && {
|
||||
. ./var/errors.var.sh; printf "\e[91m❌ Please make sure you are calling the script without leading 'sh'! Bye... \e[0m\n" >&2; exit "${ERR_UNSUPPORTED_BASH}"; }
|
||||
. ./meta_loader_early.sh
|
||||
printf "%s❌ Please make sure you are calling the script without leading 'sh'! Bye... %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
[[ ${BASH_VERSINFO[0]} -lt 5 ]] && {
|
||||
. ./var/errors.var.sh; printf "\e[91m❌ Minimum requirement is bash 5.1. You are using '%s'! Bye... \e[0m\n" "${BASH_VERSION}" >&2; exit "${ERR_UNSUPPORTED_BASH}"; }
|
||||
. ./meta_loader_early.sh
|
||||
printf "%s❌ Minimum requirement is bash 5.1. You are using '%s'! Bye... %s%s" "${C_RED}" "${BASH_VERSION}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
[[ ${BASH_VERSINFO[0]} -le 5 ]] && [[ ${BASH_VERSINFO[1]} -le 1 ]] && {
|
||||
. ./var/errors.var.sh; printf "\e[91m❌ Minimum requirement is bash 5.1. You are using '%s'! Bye... \e[0m\n" "${BASH_VERSION}" >&2; exit "${ERR_UNSUPPORTED_BASH}"; }
|
||||
. ./meta_loader_early.sh
|
||||
printf "%s❌ Minimum requirement is bash 5.1. You are using '%s'! Bye... %s%s" "${C_RED}" "${BASH_VERSION}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
[[ ${#} -eq 0 ]] && {
|
||||
. ./lib/0000_usage.sh; usage >&2; exit 1; }
|
||||
|
||||
@@ -67,17 +87,17 @@ pre_scan_debug "$@"
|
||||
|
||||
### ADVISORY LOCK
|
||||
exec 127>/var/lock/ciss_debian_installer.lock || {
|
||||
printf "\e[91m❌ Cannot open lockfile for writing! Bye... \e[0m\n" >&2
|
||||
printf "%s❌ Cannot open lockfile for writing! Bye... %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_FLOCK_PROTECTED}"
|
||||
}
|
||||
|
||||
if ! flock -x -n 127; then
|
||||
printf "\e[91m❌ Another instance is running! Bye...\e[0m\n" >&2
|
||||
printf "%s❌ Another instance is running! Bye...%s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
|
||||
exit "${ERR_FLOCK_COLLISION}"
|
||||
fi
|
||||
|
||||
### SOURCING
|
||||
[[ "${VAR_SETUP}" == true ]] && {
|
||||
[[ "${VAR_SETUP}" == "true" ]] && {
|
||||
### SOURCING BASH OPTIONS
|
||||
. ./var/bash.var.sh
|
||||
### SOURCING FUNCTIONS
|
||||
@@ -99,7 +119,7 @@ gen_dir_files
|
||||
|
||||
|
||||
### Dialog Output for Initialization
|
||||
if ! $VAR_AUTO_INSTALL; then . ./lib/0200_dialog_helper.sh && dialog_gauge; fi
|
||||
if ! "${VAR_AUTO_INSTALL}"; then . ./lib/0200_dialog_helper.sh && dialog_gauge; fi
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user