Obsolete script for SMS group multicasting through m1d
[nethome.git] / bin / smshelp
1 #! /bin/sh
2 t=/tmp/smshelp.$$
3 trap "rm -f $t $t.1 $t.2" EXIT
4 cat >$t.1
5 (head -qc 155 <$t.1|tr '\r\n' '  '|sed -e 's/:/\\:/g' -e 's/"/\\\\"/g';echo '"\r:') >$t
6 tail -c +156 <$t.1 >$t.2
7 if [ -s "$t.2" ];then
8   echo "-----------------------------------------------------------------------"
9   echo "MESSAGE TOO LONG! CUT WAS AT:"
10   cat $t.2
11   echo
12   exit 1
13   fi
14 (echo 'TOP_W:v1.0:ttermin:'
15 if [ "$1" = h -o -z "$1" ];then echo -n 'tsmsend 0603431329,"';cat $t;fi
16 if [ "$1" = l -o -z "$1" ];then echo -n 'tsmsend 0603457332,"';cat $t;fi
17 if [ "$1" = t -o -z "$1" ];then echo -n 'tsmsend 0603223050,"';cat $t;fi
18 echo 'tquit\r:'
19 sleep 5
20 )|ssh -v gps.geoinvest.cz 'exec ./src/m1d/static/gateway -le0n/dev/null'