.
[fax-sipgate.git] / fax
blob3800404a1dac0df604055247b7e0c32f35a9b6eb
1 #!/bin/zsh
2 [[ -e $HOME/.sipgate.de ]] && . $HOME/.sipgate.de
4 [[ -z $user ]] && exit 3
5 [[ -z $pass ]] && exit 3
7 faxi=/opt/corvix/lib/sipgateAPI-fax.pl
9 echo "Sending Fax."
10 echo " arg1: number in format 49..."
11 echo " arg2: file.pdf"
12 [[ -z $2 ]] && exit 1
13 [[ ! -x $faxi ]] && exit 2
15 no=$1
16 file=$2
18 [[ -e $file ]] || exit 1
20 pdftops $file - | ps2pdf - - > $file.good.pdf
21 $faxi $user $pass $no $file.good.pdf
22 rm $file.good.pdf