added support for space when adding contact
This commit is contained in:
parent
46424c86ee
commit
d9f84b6808
@ -8,15 +8,22 @@ VALID_NUMBER=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
|
|||||||
if [ "$VALID_NUMBER" = "true" ]
|
if [ "$VALID_NUMBER" = "true" ]
|
||||||
then
|
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')
|
| jq -r '.["payload"] | .name')
|
||||||
CURRENCY=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
|
CURRENCY=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \
|
||||||
| jq -r '.["payload"] | .currency')
|
| jq -r '.["payload"] | .currency')
|
||||||
echo "Account Name: $NAME"
|
echo "Account Name: $ACCOUNT_NAME"
|
||||||
echo "Currency: $CURRENCY"
|
echo "Currency: $CURRENCY"
|
||||||
echo ""
|
echo ""
|
||||||
printf 'Contact Name: '
|
printf 'Contact Name: '
|
||||||
read -r 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 \
|
ADDCONTACT=$(curl -s -b $COOKIE $BML_URL/contacts \
|
||||||
--data-raw contact_type=IAT \
|
--data-raw contact_type=IAT \
|
||||||
--data-raw account=$ACCOUNT_NUMBER \
|
--data-raw account=$ACCOUNT_NUMBER \
|
||||||
|
0
install.sh
Normal file → Executable file
0
install.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user