diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-09-25 21:32:40 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-09-25 21:32:40 +0200 |
commit | 9ebdc09f782b8adda92ff85a28a6fe372388daef (patch) | |
tree | 78609c6a3dce1f311b86499e316333d56fab3cae | |
parent | d75f02ddcbe9f1a3ff7e1bf6449a365333caff2c (diff) |
Fix grepescape() pgrep'ed phone number.
-rwxr-xr-x | localkannel-dispatch | 7 |
1 files 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 |