V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -33,14 +33,14 @@ declare -grx VAR_SETUP_FULL="$(cd "$(dirname "${0}")" && pwd)/${0##*/}" # '/opt/
|
||||
### No ash, dash, ksh, sh, zsh.
|
||||
# shellcheck disable=2292
|
||||
[ -z "${BASH_VERSINFO[0]}" ] && {
|
||||
. /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
printf "%b❌ Please make sure you are using 'bash'! Bye... %b%b" "${RED}" "${RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
### Not root.
|
||||
[[ ${EUID} -ne 0 ]] && {
|
||||
. /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
printf "%b❌ Please make sure you are 'root'! Bye... %b%b" "${RED}" "${RES}" "${NL}" >&2
|
||||
exit "${ERR_USER_IS_NOT_ROOT}"
|
||||
}
|
||||
@@ -48,35 +48,35 @@ declare -grx VAR_SETUP_FULL="$(cd "$(dirname "${0}")" && pwd)/${0##*/}" # '/opt/
|
||||
### Not called by sh.
|
||||
# shellcheck disable=2312
|
||||
[[ $(kill -l | grep -c SIG) -eq 0 ]] && {
|
||||
. /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
printf "%b❌ Please make sure you are calling the script without leading 'sh'! Bye... %b%b" "${RED}" "${RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
### Not sourced.
|
||||
[[ "${BASH_SOURCE[0]}" != "$0" ]] && {
|
||||
. /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
printf "%b❌ This script must be executed, not sourced. Please run './setup.sh' directly. %b%b" "${RED}" "${RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
### Minimum Bash version 5.
|
||||
[[ ${BASH_VERSINFO[0]} -lt 5 ]] && {
|
||||
. /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
printf "%b❌ Minimum requirement is bash 5.1. You are using '%s'! Bye... %b%b" "${RED}" "${BASH_VERSION}" "${RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
### Minimum Bash version 5.1.
|
||||
[[ ${BASH_VERSINFO[0]} -le 5 ]] && [[ ${BASH_VERSINFO[1]} -le 1 ]] && {
|
||||
. /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
printf "%b❌ Minimum requirement is bash 5.1. You are using '%s'! Bye... %b%b" "${RED}" "${BASH_VERSION}" "${RES}" "${NL}" >&2
|
||||
exit "${ERR_UNSUPPORTED_BASH}"
|
||||
}
|
||||
|
||||
### No arguments.
|
||||
[[ ${#} -eq 0 ]] && {
|
||||
. . /../../meta_loader_early.sh
|
||||
. ./meta_loader_early.sh
|
||||
usage >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user