From 9ebdc09f782b8adda92ff85a28a6fe372388daef Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 25 Sep 2010 21:32:40 +0200 Subject: Fix grepescape() pgrep'ed phone number. --- localkannel-dispatch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/localkannel-dispatch b/localkannel-dispatch index b2ac36b..f3564d1 100755 --- a/localkannel-dispatch +++ b/localkannel-dispatch @@ -18,6 +18,10 @@ exit1() { exit 1 } +grepescape() { + echo "$1" | perl -pe 's/(?=[+])/\\/g' +} + # Based on Text::Unidecode bug#8017: http://rt.cpan.org/Ticket/Display.html?id=8017#txn-322351 lctransliterate() { echo "$1" | perl -C1 -n \ @@ -355,8 +359,7 @@ esac # ;; # Bail out if another thread already active targeted same user -# FIXME: avoid juggling with leading plus here when no longer stripped from input -if pgrep -f "$to"; then +if pgrep -f "$(grepescape "$to")"; then for errorto in $SMS_ERRTO1 $SMS_ERRTO2; do SMS_PHONE="$SMS_ERRFROM" $sbindir/localsendsms "$errorto" "[warning] silently suppressed \"$app_raw\" for $to busy already" done -- cgit v1.2.3