mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-21 13:07:01 +01:00
IMP(shellcheck): add prefix to follow scripts (SC1090)
This commit is contained in:
parent
72bb3e2b84
commit
addd48c4dd
@ -171,6 +171,7 @@ fi
|
||||
|
||||
# Source Root Dir Parameter
|
||||
if [ -r /etc/default/cis-hardening ]; then
|
||||
# shellcheck source=../debian/default
|
||||
. /etc/default/cis-hardening
|
||||
fi
|
||||
if [ -z "$CIS_ROOT_DIR" ]; then
|
||||
@ -178,10 +179,13 @@ if [ -z "$CIS_ROOT_DIR" ]; then
|
||||
echo "Cannot source CIS_ROOT_DIR variable, aborting."
|
||||
exit 128
|
||||
fi
|
||||
|
||||
# shellcheck source=../lib/constants.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/constants.sh ] && . $CIS_ROOT_DIR/lib/constants.sh
|
||||
# shellcheck source=../etc/hardening.cfg
|
||||
[ -r $CIS_ROOT_DIR/etc/hardening.cfg ] && . $CIS_ROOT_DIR/etc/hardening.cfg
|
||||
# shellcheck source=../lib/common.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/common.sh ] && . $CIS_ROOT_DIR/lib/common.sh
|
||||
# shellcheck source=../lib/utils.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/utils.sh ] && . $CIS_ROOT_DIR/lib/utils.sh
|
||||
|
||||
if [ $BATCH_MODE ]; then MACHINE_LOG_LEVEL=3; fi
|
||||
|
@ -74,7 +74,7 @@ fi
|
||||
|
||||
# Main function, will call the proper functions given the configuration (audit, enabled, disabled)
|
||||
if [ -r "$CIS_ROOT_DIR"/lib/main.sh ]; then
|
||||
# shellcheck source=/opt/debian-cis/lib/main.sh
|
||||
# shellcheck source=../../lib/main.sh
|
||||
. "$CIS_ROOT_DIR"/lib/main.sh
|
||||
else
|
||||
echo "Cannot find main.sh, have you correctly defined your root directory? Current value is $CIS_ROOT_DIR in /etc/default/cis-hardening"
|
||||
|
@ -10,10 +10,13 @@ BATCH_OUTPUT=""
|
||||
status=""
|
||||
forcedstatus=""
|
||||
SUDO_CMD=""
|
||||
|
||||
# shellcheck source=constants.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/constants.sh ] && . $CIS_ROOT_DIR/lib/constants.sh
|
||||
# shellcheck source=../etc/hardening.cfg
|
||||
[ -r $CIS_ROOT_DIR/etc/hardening.cfg ] && . $CIS_ROOT_DIR/etc/hardening.cfg
|
||||
# shellcheck source=../lib/common.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/common.sh ] && . $CIS_ROOT_DIR/lib/common.sh
|
||||
# shellcheck source=../lib/utils.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/utils.sh ] && . $CIS_ROOT_DIR/lib/utils.sh
|
||||
|
||||
# Environment Sanitizing
|
||||
@ -46,6 +49,7 @@ while [[ $# > 0 ]]; do
|
||||
debug "Auditing in batch mode, will limit output by setting LOGLEVEL to 'ok'."
|
||||
BATCH_MODE=1
|
||||
LOGLEVEL=ok
|
||||
# shellcheck source=../lib/common.sh
|
||||
[ -r $CIS_ROOT_DIR/lib/common.sh ] && . $CIS_ROOT_DIR/lib/common.sh
|
||||
;;
|
||||
*)
|
||||
@ -76,7 +80,7 @@ if [ "$forcedstatus" = "createconfig" ]; then
|
||||
debug "$CIS_ROOT_DIR/etc/conf.d/$SCRIPT_NAME.cfg has been created"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r $CIS_ROOT_DIR/etc/conf.d/$SCRIPT_NAME.cfg ] && . $CIS_ROOT_DIR/etc/conf.d/$SCRIPT_NAME.cfg
|
||||
|
||||
# Now check configured value for status, and potential cmdline parameter
|
||||
|
@ -146,7 +146,7 @@ _run() {
|
||||
if [ ! -f "$(dirname "$0")"/lib.sh ]; then
|
||||
fatal "Cannot locate lib.sh"
|
||||
fi
|
||||
# shellcheck source=/opt/debian-cis/tests/lib.sh
|
||||
# shellcheck source=../tests/lib.sh
|
||||
. "$(dirname "$0")"/lib.sh
|
||||
|
||||
###################
|
||||
|
Loading…
Reference in New Issue
Block a user