File: sendsms

package info (click to toggle)
smstools 3.1-2%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,260 kB
  • ctags: 459
  • sloc: ansic: 9,720; sh: 968; php: 115; makefile: 72; awk: 17
file content (28 lines) | stat: -rwxr-xr-x 513 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# This script send a text sms at the command line by creating
# a sms file in the outgoing queue.
# I use it for testing.

# $1 is the destination phone number
# $2 is the message text
# if you leave $2 or both empty, the script will ask you

DEST=$1
TEXT=$2

if [ -z "$DEST" ]; then
  printf "Destination: "
  read DEST
fi

if [ -z "$TEXT" ]; then
  printf "Text: "
  read TEXT
fi

FILE=`mktemp /var/spool/sms/outgoing/send_XXXXXX`

echo "To: $DEST" >> $FILE
echo "" >> $FILE
echo -n "$TEXT" >> $FILE