From 08142b64fd2504b08fb15340d75d8aba48a3536e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 12 Jul 2010 18:59:08 +0200 Subject: Generalise variables gotestphones and gophones in localkannel-dispatch. --- localkannel-dispatch | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'localkannel-dispatch') diff --git a/localkannel-dispatch b/localkannel-dispatch index d75a3fb..e2e9be6 100755 --- a/localkannel-dispatch +++ b/localkannel-dispatch @@ -71,6 +71,8 @@ case "$SMS_REALM" in ;; hellotorino) provider="clickatell" + gotestphones="+393453915741 +393453805531 +393453801457" # Jonas, Jacob, Vera + gophones="+393407574815 +393407574813" # Alessandra, Vela SMS_ERRFROM="+393453915741" SMS_ERRTO1="+393453801457" SMS_ERRTO2="+393483281187" @@ -217,14 +219,10 @@ and start thread \"$realcmd\" on behalf of PHONE." [ -n "$1" ] || exit1 "target phone number missing (try \"/$cmd help\" for usage)" case "$cmd" in gotest|sotest) - info1phone="+393453915741" # Jonas - info2phone="+393453805531" # Jacob - info3phone="+393453801457" # Vera + phones="$gotestphones" ;; go|so) - info1phone="+393407574815" # Alessandra - info2phone="+393407574813" # Vela - info3phone= + phones="$gophones" ;; esac targetphone="$(echo "$1" | perl -pe 's/^@//;' -e 's/^([^+])/+39\1/')"; shift @@ -235,11 +233,9 @@ and start thread \"$realcmd\" on behalf of PHONE." # send responses (threaded one last, to work in debug mode) if [ -n "$*" ]; then - $sbindir/localsendsms "$info1phone" "[$cmd] $@" - $sbindir/localsendsms "$info2phone" "[$cmd] $@" - if [ -n "$info3phone" ]; then - $sbindir/localsendsms "$info2phone" "[$cmd] $@" - fi + for phone in $phones; do + $sbindir/localsendsms "$phone" "[$cmd] $@" + done fi $sbindir/localsendsms "$to" "[info] \"$cmd\" thread started for \"$targetphone\", and trailing message forwarded to subscribers." SMS_PHONE="$targetfrom" $sbindir/localmarkdown2sms "$targetphone" "/$realcmd" -- cgit v1.2.3