summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalkannel-dispatch7
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)