diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-09-24 20:31:25 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-09-24 20:31:25 +0200 |
commit | 11304dd4f8c0fe5f69e4431e692bcd71620a0b6e (patch) | |
tree | b7cf7427e9db1fe69c89327c04f03ee81de9aea5 /localkannel-dispatch | |
parent | d16c6107848b698b2b36866df621bf94848087a7 (diff) |
Fix lastservicephone(). shift after check.
Diffstat (limited to 'localkannel-dispatch')
-rwxr-xr-x | localkannel-dispatch | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/localkannel-dispatch b/localkannel-dispatch index d034f53..e9564db 100755 --- a/localkannel-dispatch +++ b/localkannel-dispatch @@ -40,7 +40,7 @@ getfilevar() { lastservicephone() { logfile=/var/log/kannel/smsbox.log tac $logfile $logfile.1 \ - | perl -ne "/INFO: Starting to service <.*> from <\+$1> to <([^<>]*)>/ and print \$1 and exit 0" + | perl -ne "/INFO: Starting to service <.*> from <$1> to <([^<>]*)>/ and print \$1 and exit 0" } #from=`uriunescape "$1" | sed -e 's/\+/ /g'`; shift @@ -243,12 +243,13 @@ and (if included) send MSG to subscribers." while [ -n "$1" ]; do targetphone="$(echo "$1" | perl -pe 's/^(?=[^+])/+36/;' -e '/^\+\d+$/;')" [ -n "$targetphone" ] || continue - targetphones="${targetphones:+$targetphones }$targetphone" - shift # Sanity check targetfrom=$(lastservicephone "$targetphone") [ -n "$targetfrom" ] || exit1 "refusing to redirect: unknown target phone number \"$targetphone\"." + + targetphones="${targetphones:+$targetphones }$targetphone" + shift done # send responses (threaded one last, to work in debug mode) |