Skip to content

Commit

Permalink
Use correct user on login and logout
Browse files Browse the repository at this point in the history
  • Loading branch information
angelofenoglio committed Oct 30, 2024
1 parent f770688 commit bc62eef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/aws-sso/aws-sso-login.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ function log {
# -----------------------------------------------------------------------------
# Initialize variables
# -----------------------------------------------------------------------------
USR=$(whoami)
USR_HOME=$([ "$USR" != "root" ] && echo "home/$USR")
SCRIPT_LOG_LEVEL=${SCRIPT_LOG_LEVEL:-2}
PROJECT=$(hcledit -f "$COMMON_CONFIG_FILE" attribute get project | sed 's/"//g')
SSO_PROFILE_NAME=${SSO_PROFILE_NAME:-$PROJECT-sso}
SSO_CACHE_DIR=${SSO_CACHE_DIR:-/home/leverage/tmp/$PROJECT/sso/cache}
AWS_SSO_CACHE_DIR=/home/leverage/.aws/sso/cache
SSO_CACHE_DIR=${SSO_CACHE_DIR:-"/${USR_HOME}/tmp/$PROJECT/sso/cache"}
AWS_SSO_CACHE_DIR="/${USR_HOME}/.aws/sso/cache"
SSO_TOKEN_FILE_NAME='token'
debug "SCRIPT_LOG_LEVEL=$SCRIPT_LOG_LEVEL"
debug "COMMON_CONFIG_FILE=$COMMON_CONFIG_FILE"
Expand Down
4 changes: 3 additions & 1 deletion scripts/aws-sso/aws-sso-logout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ function log {
# -----------------------------------------------------------------------------
# Initialize variables
# -----------------------------------------------------------------------------
USR=$(whoami)
USR_HOME=$([ "$USR" != "root" ] && echo "home/$USR")
SCRIPT_LOG_LEVEL=${SCRIPT_LOG_LEVEL:-2}
PROJECT=$(hcledit -f "$COMMON_CONFIG_FILE" attribute get project | sed 's/"//g')
SSO_CACHE_DIR=${SSO_CACHE_DIR:-/home/leverage/tmp/$PROJECT/sso/cache}
SSO_CACHE_DIR=${SSO_CACHE_DIR:-"/${USR_HOME}/tmp/$PROJECT/sso/cache"}
debug "SCRIPT_LOG_LEVEL=$SCRIPT_LOG_LEVEL"
debug "AWS_SHARED_CREDENTIALS_FILE=$AWS_SHARED_CREDENTIALS_FILE"
debug "AWS_CONFIG_FILE=$AWS_CONFIG_FILE"
Expand Down

0 comments on commit bc62eef

Please sign in to comment.