Some UX changes
This commit is contained in:
parent
fef572359f
commit
e09ff8f7b9
|
@ -1,7 +1,7 @@
|
||||||
BASEPATH=$(dirname $(realpath $0))
|
BASEPATH=$(dirname $(realpath $0))
|
||||||
. $BASEPATH/.env
|
. $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" ] || [ $AUTH_TOKEN = "null" ];
|
||||||
then
|
then
|
||||||
echo "Login failed"
|
echo "Login failed"
|
||||||
else
|
else
|
||||||
|
|
|
@ -51,10 +51,13 @@ OUTFILE="$DATE-$ID-report.pdf"
|
||||||
if [ -z $FILE ]
|
if [ -z $FILE ]
|
||||||
then
|
then
|
||||||
echo "Fax seems not to be sent successfully (yet). No report available"
|
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 ]
|
||||||
if [[ $DF = true && $DIN =~ [yYjJ] ]]
|
|
||||||
then
|
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
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue