added support for space when adding contact

This commit is contained in:
Shihaam Abdul Rahman 2021-04-28 02:25:58 +05:00
parent 46424c86ee
commit d9f84b6808
2 changed files with 9 additions and 2 deletions

View File

@ -8,15 +8,22 @@ VALID_NUMBER=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
if [ "$VALID_NUMBER" = "true" ]
then
NAME=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
ACCOUNT_NAME=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
| jq -r '.["payload"] | .name')
CURRENCY=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
| jq -r '.["payload"] | .currency')
echo "Account Name: $NAME"
echo "Account Name: $ACCOUNT_NAME"
echo "Currency: $CURRENCY"
echo ""
printf 'Contact Name: '
read -r CONTACT_NAME
if [ "$CONTACT_NAME" = "" ]
then
CONTACT_NAME=$ACCOUNT_NAME
else
:
fi
CONTACT_NAME=`echo "$CONTACT_NAME" | sed "s/ /%20/"`
ADDCONTACT=$(curl -s -b $COOKIE $BML_URL/contacts \
--data-raw contact_type=IAT \
--data-raw account=$ACCOUNT_NUMBER \

0
install.sh Normal file → Executable file
View File