From 6e6a57f61bf88e3d8e6778a7d378400aa7b72787 Mon Sep 17 00:00:00 2001 From: ReachableCEO Date: Mon, 30 Jun 2025 13:28:13 -0500 Subject: [PATCH] D.R.Y. --- Project-ConfigFiles/CONFIG_VARS | 3 ++ .../Modules/Security/secharden-scap-stig.sh | 28 ------------------- 2 files changed, 3 insertions(+), 28 deletions(-) create mode 100644 Project-ConfigFiles/CONFIG_VARS diff --git a/Project-ConfigFiles/CONFIG_VARS b/Project-ConfigFiles/CONFIG_VARS new file mode 100644 index 0000000..d0c99d8 --- /dev/null +++ b/Project-ConfigFiles/CONFIG_VARS @@ -0,0 +1,3 @@ + +export DL_ROOT +DL_ROOT="https://dl.knownelement.com/KNEL/FetchApply/" \ No newline at end of file diff --git a/ProjectCode/Modules/Security/secharden-scap-stig.sh b/ProjectCode/Modules/Security/secharden-scap-stig.sh index b75838e..0e5ed84 100644 --- a/ProjectCode/Modules/Security/secharden-scap-stig.sh +++ b/ProjectCode/Modules/Security/secharden-scap-stig.sh @@ -1,31 +1,5 @@ #!/bin/bash -set -o errexit -set -o nounset -set -o pipefail -set -o functrace - -export PS4='(${BASH_SOURCE}:${LINENO}): - [${SHLVL},${BASH_SUBSHELL},$?] $ ' - -function error_out() -{ - echo "Bailing out. See above for reason...." - exit 1 -} - -function handle_failure() { - local lineno=$1 - local fn=$2 - local exitstatus=$3 - local msg=$4 - local lineno_fns=${0% 0} - if [[ "$lineno_fns" != "-1" ]] ; then - lineno="${lineno} ${lineno_fns}" - fi - echo "${BASH_SOURCE[0]}: Function: ${fn} Line Number : [${lineno}] Failed with status ${exitstatus}: $msg" -} - -trap 'handle_failure "${BASH_LINENO[*]}" "$LINENO" "${FUNCNAME[*]:-script}" "$?" "$BASH_COMMAND"' ERR function pi-detect() { @@ -42,8 +16,6 @@ echo Completed running "$FUNCNAME" # Actual script logic starts here -export DL_ROOT -DL_ROOT="https://dl.knownelement.com/KNEL/FetchApply/" # Sourced from