mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
Ensures JSON is the default AWS command output.
This commit is contained in:
15
prowler
15
prowler
@@ -51,6 +51,15 @@ TITLE_TEXT="CALLER ERROR - UNSET TITLE"
|
||||
WHITELIST_FILE=""
|
||||
TOTAL_CHECKS=()
|
||||
|
||||
# Ensures command output will always be set to JSON.
|
||||
# If the default value is already set, ORIGINAL_OUTPUT will be used to store it and reset it at cleanup
|
||||
if [[ -z "${AWS_DEFAULT_OUTPUT}" ]]; then
|
||||
ORIGINAL_OUTPUT=$AWS_DEFAULT_OUTPUT
|
||||
export AWS_DEFAULT_OUTPUT="json"
|
||||
else
|
||||
export AWS_DEFAULT_OUTPUT="json"
|
||||
fi
|
||||
|
||||
# Command usage menu
|
||||
usage(){
|
||||
echo "
|
||||
@@ -200,6 +209,12 @@ clean_up() {
|
||||
if [[ "${MODES[@]}" =~ "html" ]]; then
|
||||
addHtmlFooter >> ${OUTPUT_FILE_NAME}.$EXTENSION_HTML
|
||||
fi
|
||||
# puts the AWS_DEFAULT_OUTPUT back to what it was at the start
|
||||
if [ -z "$ORIGINAL_OUTPUT"]; then
|
||||
export AWS_DEFAULT_OUTPUT="$ORIGINAL_OUTPUT"
|
||||
else
|
||||
unset AWS_DEFAULT_OUTPUT
|
||||
fi
|
||||
}
|
||||
|
||||
handle_ctrl_c() {
|
||||
|
||||
Reference in New Issue
Block a user