mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
Set defaults for environment variables
This change sets the defaults for PROFILE and REGION before they're set by getopts, allowing us to add support for more options without needing to update the default setting code that happened after the options were parsed.
This commit is contained in:
10
prowler
10
prowler
@@ -45,8 +45,9 @@ RED="[1;31m"
|
||||
YELLOW="[1;33m"
|
||||
WHITE="[1;37m"
|
||||
|
||||
DEFULT_AWS_PROFILE="default"
|
||||
DEFAULT_AWS_REGION="us-east-1"
|
||||
# Set the defaults for these getopts variables
|
||||
PROFILE="default"
|
||||
REGION="us-east-1"
|
||||
|
||||
# Command usage menu
|
||||
usage(){
|
||||
@@ -160,11 +161,6 @@ else
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "$#" -le 2 ]]; then
|
||||
PROFILE=$DEFULT_AWS_PROFILE
|
||||
REGION=$DEFAULT_AWS_REGION
|
||||
fi
|
||||
|
||||
if [[ ! -f ~/.aws/credentials ]]; then
|
||||
echo -e "\n$RED ERROR!$NORMAL AWS credentials file not found (~/.aws/credentials). Run 'aws configure' first. \n"
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user