Compare commits

...

2 commits

2 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,7 @@
BASEPATH=$(dirname $(realpath $0))
. $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" ];
if [ -z "$AUTH_TOKEN" ] || [ $AUTH_TOKEN = "null" ];
then
echo "Login failed"
else

View file

@ -51,11 +51,14 @@ OUTFILE="$DATE-$ID-report.pdf"
if [ -z $FILE ]
then
echo "Fax seems not to be sent successfully (yet). No report available"
if [ $DF = true ]
then
read -p "Delete id from history anyways? (y/n) " DIN
if [[ $DF = true && $DIN =~ [yYjJ] ]]
if [ $DIN =~ [yYjJ] ]
then
echo "$(grep -v "^$ID$" $BASEPATH/.fax_history)" > $BASEPATH/.fax_history
fi
fi
exit 1
fi
if [ $PF = false ]