Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ readonly USER_NAME="${1}"
readonly WORK_DIRECTORY="${2}"
readonly CLOUD="${3}"
# shellcheck disable=SC2034
readonly LOG_IN="${4}"
LOG_IN="${4}"

##############################################
# Get absolute paths of the script directories
Expand Down Expand Up @@ -51,8 +51,11 @@ source "${SCRIPT_DIR}/emit.sh"
# CLI login
#############################
readonly RUN_AS_LOGIN_USER="sudo -u ${USER_NAME} bash -l -c"
if [[ "${LOG_IN}" == "true" ]] && ${RUN_AS_LOGIN_USER} "'{$WORKBENCH_INSTALL_PATH}' auth status 2>&1" | grep -q "NO USER LOGGED IN"; then
${RUN_AS_LOGIN_USER} "'{$WORKBENCH_INSTALL_PATH}' auth login --mode=APP_DEFAULT_CREDENTIALS"
if [[ "${LOG_IN}" == "true" ]] && ${RUN_AS_LOGIN_USER} "'${WORKBENCH_INSTALL_PATH}' auth status 2>&1" | grep -q "NO USER LOGGED IN"; then
if ! ${RUN_AS_LOGIN_USER} "'${WORKBENCH_INSTALL_PATH}' auth login --mode=APP_DEFAULT_CREDENTIALS"; then
emit "Workbench CLI login failed; skipping resource mount."
LOG_IN="false"
fi
fi

#############################
Expand Down
9 changes: 6 additions & 3 deletions startupscript/remount-on-restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ readonly USER_NAME="${1}"
readonly WORK_DIRECTORY="${2}"
readonly CLOUD="${3}"
# shellcheck disable=SC2034
readonly LOG_IN="${4}"
LOG_IN="${4}"

##############################################
# Get absolute paths of the script directories
Expand Down Expand Up @@ -51,8 +51,11 @@ source "${SCRIPT_DIR}/emit.sh"
# CLI login
#############################
readonly RUN_AS_LOGIN_USER="sudo -u ${USER_NAME} bash -l -c"
if [[ "${LOG_IN}" == "true" ]] && ${RUN_AS_LOGIN_USER} "'{$WORKBENCH_INSTALL_PATH}' auth status 2>&1" | grep -q "NO USER LOGGED IN"; then
${RUN_AS_LOGIN_USER} "'{$WORKBENCH_INSTALL_PATH}' auth login --mode=APP_DEFAULT_CREDENTIALS"
if [[ "${LOG_IN}" == "true" ]] && ${RUN_AS_LOGIN_USER} "'${WORKBENCH_INSTALL_PATH}' auth status 2>&1" | grep -q "NO USER LOGGED IN"; then
if ! ${RUN_AS_LOGIN_USER} "'${WORKBENCH_INSTALL_PATH}' auth login --mode=APP_DEFAULT_CREDENTIALS"; then
emit "Workbench CLI login failed; skipping resource mount."
LOG_IN="false"
fi
fi

#############################
Expand Down
Loading