Skip to content

Commit 7f7015c

Browse files
authored
fix (#426)
2 parents 9a1e03b + 7e52f3f commit 7f7015c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dev/troubleshooting/login_test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,25 @@ if [[ -z "$url" || -z "$user" ]]; then
4343
usage
4444
fi
4545

46+
if [[ -n "$DIGMA_PASSWORD" ]]; then
47+
echo "Using password from DIGMA_PASSWORD environment variable"
48+
pwd="$DIGMA_PASSWORD"
49+
fi
50+
4651
# Prompt for password if not provided
4752
if [[ -z "$pwd" ]]; then
4853
echo -n "Enter password for user '$user': "
4954
read -s pwd
5055
echo ""
5156
fi
5257

58+
if [[ -z "$pwd" ]]; then
59+
echo "Password is required but not provided. Please run the script with --pwd option or set DIGMA_PASSWORD environment variable." >&2
60+
echo "Example: DIGMA_PASSWORD=mypassword curl -s https://raw.githubusercontent.com/digma-ai/digma/main/dev/troubleshooting/login_test.sh | bash -s -- --url <URL> --user <USER> --token <TOKEN>" >&2
61+
exit 1
62+
fi
63+
64+
5365
echo -n "login to $url/Authentication/login"
5466
echo ""
5567
response=$(curl -s -w "HTTPSTATUS:%{http_code}" -X 'POST' \

0 commit comments

Comments
 (0)