.
[fax-sipgate.git] / fax
blob36be44902e1e1d261fde394d8e2fcfbf551b4ff7
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 faxi=/opt/corvix/lib/sipgateAPI-fax.pl
10 echo "Sending Fax."
11 echo " arg1: number in format 49..."
12 echo " arg2: file.pdf"
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 file=$2
25 [[ -e $file ]] || exit 1
27 pdftops $file - | ps2pdf - - > $file.good.pdf
28 faxi $user $pass $no $file.good.pdf
29 rm $file.good.pdf