added token generator and getting token from token.json

This commit is contained in:
Kim 2023-03-23 16:58:26 +01:00
parent 888a9f716b
commit f62375ae54
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## USAGE: ./newToken.sh -u USERNAME -p PASSWORD ## USAGE: ./newToken.sh -u Username -p Password -n UniqueTokenName
while getopts u:p:n: flag while getopts u:p:n: flag
@ -18,7 +18,7 @@ response=$(curl --request POST \
echo -n '{"bearer' > token.json echo -n '{"bearer' > token.json
token=$(echo $response | jq ".token") token=$(echo $response | jq ".token")
#echo ${token:1:-1}
uid=$(echo $response | jq ".idUser") uid=$(echo $response | jq ".idUser")
echo -n ${response:7:-1} >> token.json echo -n ${response:7:-1} >> token.json