2022-03-22 09:30:29 +00:00
|
|
|
BAL=$(curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --user $SIPUSER:$SIPPWD "https://api.sipgate.com/v2/balance" -s)
|
2021-03-04 17:57:12 +00:00
|
|
|
AMOUNT=$(echo $BAL | jq '.amount')
|
|
|
|
CUR=$(echo $BAL | jq '.currency' | sed -e 's:"::g' )
|
|
|
|
AMOUNT=$(echo "scale=2; $AMOUNT/10000" | bc -l)
|
2021-03-04 18:44:27 +00:00
|
|
|
echo "Your current balance is "$CUR $AMOUNT
|