apply env.patch

This commit is contained in:
Gandalf 2021-03-13 14:50:48 +01:00
parent dabaae95cf
commit a75c71ad95
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@
This is a small hack to send faxes via the sipgate REST API from the command line. This is a small hack to send faxes via the sipgate REST API from the command line.
## Deployment ## 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 ## Usage
`./fax.sh <letter.pdf> <recipient>` `./fax.sh <letter.pdf> <recipient>`

View file

@ -1,5 +1,5 @@
BASEPATH=$(dirname $(realpath $0)) 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') 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" ]; if [ -z "$AUTH_TOKEN" ];
then then