File: bestsms.sh

package info (click to toggle)
smssend 3.4-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,232 kB
  • ctags: 114
  • sloc: sh: 11,314; ansic: 2,368; perl: 104; makefile: 58
file content (75 lines) | stat: -rwxr-xr-x 2,201 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
#
# Copyright 2002 Pavel Machek <pavel@ucw.cz>, distribute under GPLv2
#
# Send sms to using www gateway of provider of target phone. Type "bestsms" for
# help.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
if [ a$1 = a ];
      then
      echo bestsms [-f] number message
      echo
      echo Bestsms attempts to send sms message using recipient providers SMS
      echo gateway. Nubmer should be in +420603123456 format: +, country code,
      echo rest of number.
      echo
      echo -f attempt to send flash message
      fi

if [ a$1 = a-f ];
      then
      FLASH=yes
      shift
      fi
NUMBER=`echo $1 | sed s/+//`
TEXT="$2"

paegas()
{
      smssend paeagas `echo $NUMBER | sed "s/^42//" | sed "s/......$//"` `echo $NUMBER | sed s/^420...//` "$TEXT"
}

eurotel()
{
      smssend eurotel `echo $NUMBER | sed "s/^42//" | sed "s/......$//"` `echo $NUMBER | sed s/^420...//` "$TEXT"
}

oskar()
{
      smssend oskar `echo $NUMBER | sed s/^420...//` "$TEXT"
}

case $NUMBER in
# Czech republic
      420603*) paegas ;;
      420604*) paegas ;;
      420605*) paegas ;;
      420601*) eurotel ;;
      420602*) eurotel ;;
      420606*) eurotel ;;
      420607*) eurotel ;;
      420723*) eurotel ;;
      420724*) eurotel ;;
      420608*) oskar ;;
# mts [FIXME: not checked]
      7902*) smssend mts $NUMBER $TEXT ;;
      7905*) smssend mts $NUMBER $TEXT ;;
# germany is supported by VLF

      *)	echo Sorry, unknown prefix in $NUMBER, please find operator for that phone and extend bestsms script
              ;;
esac