Allow phone number find in send text submenu

This allow the user to use a non formated phone number. We
split valid number check in a dedicated script to allow this.
This commit is contained in:
Stacy Harper 2021-09-18 11:55:25 +02:00
parent 55985a8f20
commit 87d86b7cf0
No known key found for this signature in database
GPG key ID: EABA44759877E02A
3 changed files with 30 additions and 28 deletions

View file

@ -29,12 +29,12 @@ choosenumbermenu() {
)"
fi
if echo "$NUMBER" | grep -q "Cancel"; then
if printf %s "$NUMBER" | grep -q "Cancel"; then
exit 1
elif ! echo "$NUMBER" | grep -qE '^[+0-9]+$'; then
notify-send "That doesn't seem like a valid number"
elif NUMBER="$(sxmo_validnumber.sh "$NUMBER")"; then
printf %s "$NUMBER"
else
echo "$NUMBER"
notify-send "That doesn't seem like a valid number"
fi
}