Some UX changes

master
Gandalf 2022-02-05 18:06:24 +01:00
parent fef572359f
commit e09ff8f7b9
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,10 +51,13 @@ OUTFILE="$DATE-$ID-report.pdf"
if [ -z $FILE ]
then
echo "Fax seems not to be sent successfully (yet). No report available"
read -p "Delete id from history anyways? (y/n) " DIN
if [[ $DF = true && $DIN =~ [yYjJ] ]]
if [ $DF = true ]
then
echo "$(grep -v "^$ID$" $BASEPATH/.fax_history)" > $BASEPATH/.fax_history
read -p "Delete id from history anyways? (y/n) " DIN
if [ $DIN =~ [yYjJ] ]
then
echo "$(grep -v "^$ID$" $BASEPATH/.fax_history)" > $BASEPATH/.fax_history
fi
fi
exit 1
fi