mirror of
https://github.com/m8tin/cis.git
synced 2026-08-01 11:47:31 +02:00
The module can be loaded just once now.
This commit is contained in:
+4
-1
@@ -9,6 +9,9 @@
|
|||||||
&& echo "Version 4 or newer is required, bash has version : '${BASH_VERSION}'." >&2 \
|
&& echo "Version 4 or newer is required, bash has version : '${BASH_VERSION}'." >&2 \
|
||||||
&& exit 1
|
&& exit 1
|
||||||
|
|
||||||
|
# Prevents loading this module twice
|
||||||
|
[ "${CIS[SET]}" == "ready" ] && return 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function base.checkAllInputParameters() {
|
function base.checkAllInputParameters() {
|
||||||
@@ -412,7 +415,7 @@ if [ "${BASH_SOURCE[0]}" == "${0}" ]; then
|
|||||||
declare -F | grep "base." | cut -d" " -f3 | xargs -n1 printf -- " %s\n"
|
declare -F | grep "base." | cut -d" " -f3 | xargs -n1 printf -- " %s\n"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "${CIS[SET]}" == "ready" ]; then
|
elif [ "${CIS[SET]}" == "ready" ]; then
|
||||||
base.log debug "Module '${BASH_SOURCE[0]}' already loaded"
|
base.abort "Module '${BASH_SOURCE[0]}' already loaded."
|
||||||
else
|
else
|
||||||
# If not exists, define a global array 'COLOR'
|
# If not exists, define a global array 'COLOR'
|
||||||
trap "base.abort ' User-initiated termination.'" INT \
|
trap "base.abort ' User-initiated termination.'" INT \
|
||||||
|
|||||||
Reference in New Issue
Block a user