summaryrefslogtreecommitdiff
path: root/localkannel-dispatch
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-07-10 13:18:10 +0200
committerJonas Smedegaard <dr@jones.dk>2010-07-10 13:18:10 +0200
commit08307caff31c7e6504d89afc314ddca5a6278188 (patch)
tree41b8231e974f21214a15d90fd28aa4832f17c2a5 /localkannel-dispatch
parent71cdd840351e58110841088c0db326b8b54eee59 (diff)
Relax /go command to only optionally send MSG in localkannel-dispatch.
Diffstat (limited to 'localkannel-dispatch')
-rwxr-xr-xlocalkannel-dispatch17
1 files changed, 9 insertions, 8 deletions
diff --git a/localkannel-dispatch b/localkannel-dispatch
index f478f6b..a478221 100755
--- a/localkannel-dispatch
+++ b/localkannel-dispatch
@@ -206,16 +206,15 @@ Respond \"pong\" and echo back any addition input."
esac
if [ "help" = "$1" ]; then
$sbindir/localsendsms "$to" "Usage:
-/$realcmd PHONE MSG...
-/${realcmd}test PHONE MSG...
+/$realcmd PHONE [MSG...]
+/${realcmd}test PHONE [MSG...]
/$realcmd help
Send \"[$cmd] MSG...\" to ${realcmd}test subscribers,
and start thread \"$realcmd\" on behalf of PHONE."
exit 0
fi
- [ -n "$1" ] || exit1 "phone number missing (try \"/$cmd help\" for usage)"
- [ -n "$2" ] || exit1 "message missing (try \"/$cmd help\" for usage)"
+ [ -n "$1" ] || exit1 "target phone number missing (try \"/$cmd help\" for usage)"
case "$cmd" in
gotest|sotest)
info1phone="+393453915741" # Jonas
@@ -243,10 +242,12 @@ and start thread \"$realcmd\" on behalf of PHONE."
[ -n "$targetfrom" ] || exit1 "refusing to redirect: unknown target phone number \"$targetphone\"."
# send responses (threaded one last, to work in debug mode)
- SMS_PHONE="$info1from" $sbindir/localsendsms "$info1phone" "[$cmd] $@"
- SMS_PHONE="$info2from" $sbindir/localsendsms "$info2phone" "[$cmd] $@"
- if [ -n "$info3phone" ]; then
- SMS_PHONE="$info3from" $sbindir/localsendsms "$info2phone" "[$cmd] $@"
+ if [ -n "$*" ]; then
+ SMS_PHONE="$info1from" $sbindir/localsendsms "$info1phone" "[$cmd] $@"
+ SMS_PHONE="$info2from" $sbindir/localsendsms "$info2phone" "[$cmd] $@"
+ if [ -n "$info3phone" ]; then
+ SMS_PHONE="$info3from" $sbindir/localsendsms "$info2phone" "[$cmd] $@"
+ fi
fi
SMS_PHONE="$targetfrom" $sbindir/localmarkdown2sms "$targetphone" "/$realcmd"
exit 0