.
[fax-sipgate.git] / .deb / opt / corvix / bin / fax
blob46a66d25307625ca2546fd2142580ca42981f2e1
1 #!/bin/zsh
2 . /opt/corvix/etc/sipgate.de
3 [[ -e $HOME/.sipgate.de ]] && . $HOME/.sipgate.de
5 [[ -z $user ]] && exit 3
6 [[ -z $pass ]] && exit 3
8 smsi=/opt/corvix/lib/sipgateAPI-sms.pl
10 echo "Sending SMS."
11 echo " arg1: number in format 49..."
12 echo " arg2: \"message\""
13 [[ -z $2 ]] && exit 1
14 [[ ! -x $smsi ]] && exit 2
16 if [[ -e $HOME/.phonebook ]]; then
17 if [[ grep $1 $HOME/.phonebook ]]; then
18 no=$(cat $HOME/.phonebook | awk '{print $2}')
22 no=$1
23 message=$2
24 $smsi $user $pass $no $message