diff --git a/README.md b/README.md index 5924a81..03a56fe 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a small hack to send faxes via the sipgate REST API from the command line. ## Deployment -Add your login credentials to `login_credentials_muster.sh` and rename the file to `login_credentials.sh` +Add your login credentials to `login_credentials_muster.sh` and rename the file to `.env` ## Usage `./fax.sh ` diff --git a/authorization.sh b/authorization.sh index c34dbbb..1c1a91d 100755 --- a/authorization.sh +++ b/authorization.sh @@ -1,5 +1,5 @@ BASEPATH=$(dirname $(realpath $0)) -. $BASEPATH/login_credentials.sh +. $BASEPATH/.env AUTH_TOKEN=$(echo $(curl --request POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --data-urlencode client_id=sipgate-app-web --data-urlencode grant_type=password --data-urlencode username=$SIPUSER --data-urlencode password=$SIPPWD https://api.sipgate.com/login/sipgate-apps/protocol/openid-connect/token -s | jq '.access_token') | sed 's/\"//g') if [ -z "$AUTH_TOKEN" ]; then