diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-07-12 18:59:08 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-07-12 18:59:08 +0200 |
commit | 08142b64fd2504b08fb15340d75d8aba48a3536e (patch) | |
tree | 672dea67aca8b58ac5640d3701db67e2db9d3774 /localkannel-dispatch | |
parent | 1b3186ebd1a3201fc91c740f6d1638d7d109c3c6 (diff) |
Generalise variables gotestphones and gophones in localkannel-dispatch.
Diffstat (limited to 'localkannel-dispatch')
-rwxr-xr-x | localkannel-dispatch | 18 |
1 files changed, 7 insertions, 11 deletions
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" |