From 08307caff31c7e6504d89afc314ddca5a6278188 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 10 Jul 2010 13:18:10 +0200 Subject: Relax /go command to only optionally send MSG in localkannel-dispatch. --- localkannel-dispatch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'localkannel-dispatch') 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 -- cgit v1.2.3