Cette partie prolonge la section 22.10.
A ce stade, vous devriez lire la section sendfax
de la page d'info de mgetty.
La commande sendfax est essentiellement
un programme qui envoie des télécopies via un modem. De la
même manière que mgetty, elle lit un fichier
de configuration dans /etc/mgetty+sendfax/.
Ce fichier de configuration s'appelle sendfax.config
et peut contenir une information aussi minimale que:
verbose y
debug 5 fax-devices ttyS0 fax-id 27 21 7654321 max-tries 3 max-tries-continue y |
fax:\
:sd=/var/spool/lpd/fax:\ :mx#0:\ :sh:\ :lp=/dev/null:\ :if=/var/spool/lpd/fax/fax_filter.sh: |
#!/bin/sh
exec 1»/var/log/fax exec 2»/var/log/fax echo echo echo $@ echo ``Starting fax `date`: I am `id`'' export DISPLAY=localhost:0.0 export HOME=/home/lp function error() { gdialog -title ``Send Fax'' -msgbox ``$1'' 10 75 || \ echo 'Huh? no gdialog on this machine' cd / rm -Rf /tmp/$$fax || \ gdialog \ -title ``Send Fax'' \ -msgbox ``rm -Rf /tmp/$$fax failed'' \ 10 75 exit 1 } mkdir /tmp/$$fax || error ``mkdir /tmp/$$fax failed'' cd /tmp/$$fax || error ``cd /tmp/$$fax failed'' cat > fax.ps if /usr/bin/gdialog \ - title ``Send Fax'' \ -inputbox ``Enter the phone number to fax:'' \ 10 75 ``'' 2>TEL; then : else echo ``gdialog failed'' `< TEL`'' rm -Rf /tmp/$$fax exit 0 fi TEL=`< TEL` test -z ``$TEL'' && error 'no telephone number given' cat fax.ps | gs -r204x98 -sOutputFile=- -sDEVICE=faxg3 -dBATCH -q - \ 1>fax.ps.g3 || error 'gs failed' ls -al /var/lock/ /usr/sbin/sendfax -x 5 -n -l ttyS0 STEL fax.ps.g3 || \ error ``sendfax failed'' rm -Rf /tmp/$$fax exit 0 |