📄 0149-0152.html
字号:
<HTML>
<HEAD>
<TITLE>Sams Teach Yourself Linux in 24 Hours:Connecting to the Outside World:EarthWeb Inc.-</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311623 //-->
<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->
<!-- AUTHOR=Bill Ball//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=09 //-->
<!-- PAGES=0139-0160 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0145-0148.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0153-0156.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-149"><P>Page 149</P></A>
<!-- CODE //-->
<PRE>
# line to initialize
INITLINE=cua1
# timeout in seconds before disconnect
TIMEOUT=60
# initialize modem
INIT="" AT\r OK\r\n
WAITFOR=RING
# modem connect
CONNECT="" ATA\r CONNECT\s\A
# delay in seconds before sending contents of /etc/issue
DELAY=1
</PRE>
<!-- END CODE //-->
<P>Change the values for ALTLOCK, ALTLINE, and
INITLINE to match your file's name and serial port. The
TIMEOUT value is the amount of time in seconds your modem will wait for
a carriage return from the caller before it disconnects. The
INIT string initializes your modem (note that you could also put the previous AT command string in here, too), and
the CONNECT string contains the AT command to answer the phone. The
DELAY is the amount of time in seconds before the contents of the file
/etc/issue, the login banner, is sent to the screen.
</P>
<TABLE BGCOLOR=#FFFF99>
<TR><TD>JUST A MINUTE</TD></TR>
<TR><TD>
<BLOCKQUOTE>
You should be familiar with the contents of the
/etc/issue file, because it contains the text printed
on your display right before the login prompt. This file
is created by the startup script rc.local in the
/etc/rc.d directory every time you start Linux as part of the booting process. You can customize the
rc.local script if you'd like a different login banner.
</BLOCKQUOTE>
</TD></TR>
</TABLE>
<P>The third step involves a one-line edit of the
/etc/inittab, or initialization table, file. If you
look in this file, you should see these lines:
</P>
<!-- CODE //-->
<PRE>
# cat /etc/inittab
...
# Run gettys in standard runlevels
1:12345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
...
</PRE>
<!-- END CODE //-->
<P>Each line represents a different Linux runlevel, documented at the beginning of the
/etc/inittab file. This discussion doesn't cover runlevels or the details of how Linux boots, but all
you have to do to enable dial-in logins for your Linux system is to change the following line:
</P>
<!-- CODE SNIP //-->
<PRE>
3:2345:respawn:/sbin/mingetty tty3
</PRE>
<!-- END CODE SNIP //-->
<P>to
</P>
<A NAME="PAGENUM-150"><P>Page 150</P></A>
<!-- CODE SNIP //-->
<PRE>
3:2345:respawn:/sbin/uugetty -d /etc/conf.uugetty.ttyS1 ttyS1 38400 vt100
</PRE>
<!-- END CODE SNIP //-->
<P>You should then save the file and restart your system. This line tells Linux to start the
uugetty command and have uugetty monitor your
/dev/ttyS1 serial port for incoming calls. If you
call into your Linux system, the modem will synchronize with your calling modem's speed,
wait for a carriage return (or Enter keystroke), and then present a login prompt.
</P>
<TABLE BGCOLOR=#FFFF99>
<TR><TD>TIME SAVER</TD></TR>
<TR><TD>
<BLOCKQUOTE>
If you've set up your system to accept incoming calls, you should run
minicom as the root operator and make sure that the serial device listed under serial
port setup in the configuration menu is the name of your modem's actual device,
such as /dev/cua1, and not a symbolic link such as
/dev/modem.
</BLOCKQUOTE>
</TD></TR>
</TABLE>
<H3><A NAME="ch09_ 12">
Sending and Receiving Faxes
</A></H3>
<P>If your modem supports fax protocols, chances are that you can send and receive faxes
with Linux. Sending and receiving faxes under Linux involves graphics translation of
received files and files you want to send. Your Linux distribution on the CD-ROM contains the
efax family of fax software and documentation. You should have your modem's
documentation on hand and read the efax manual pages and documentation under the
/usr/doc directory carefully before you start.
</P>
<H4><A NAME="ch09_ 13">
Faxing with the efax System
</A></H4>
<P>The efax system, by Ed Casas, is a simple and easy-to-use fax system, best suited,
according to its documentation, to a single-user, standalone Linux system. This software consists
of a series of programs and scripts, and supports Class 1 and 2 fax modems.
</P>
<P>The system is made up of the following programs:
</P>
<UL>
<LI> /usr/bin/efax—The faxing program
<LI> /usr/bin/efix—A graphics conversion program used to prepare text files for faxing
or converting files to different graphics formats
<LI> /usr/bin/fax—A shell script used to create, send, receive, display, or print fax files
</UL>
<P>If you want to preview or fax PostScript graphics files, you'll also need to have the
gs PostScript interpreter and the companion viewer,
ghostview, installed on your system. For viewing received faxes, you can use the X11 clients
xv, xloadimage, or xwud.
</P>
<A NAME="PAGENUM-151"><P>Page 151</P></A>
<P>
<CENTER>
<TABLE BGCOLOR="#FFFF99">
<TR><TD><B>
CAUTION
</B></TD></TR>
<TR><TD>
<BLOCKQUOTE>
Before you make changes to the /usr/bin/fax shell script, make a copy first. If
you make errors or delete the file, you'll need to reinstall the
efax software.
</BLOCKQUOTE></TD></TR>
</TABLE></CENTER>
</P>
<P>Before you start sending or receiving faxes, you should take a look at the
/usr/bin/fax shell script. This program is the main way you'll send or receive faxes, but you'll need to
check several sections in the file to make sure that the script is configured properly. For
example, the first section lists the names of the
efax programs:
</P>
<!-- CODE SNIP //-->
<PRE>
FAX=/usr/bin/fax
EFAX=/usr/bin/efax
EFIX=/usr/bin/efix
</PRE>
<!-- END CODE SNIP //-->
<P>These shouldn't pose a problem, because the programs are installed in the correct
place when you installed the software. The next section lists your modem:
</P>
<!-- CODE SNIP //-->
<PRE>
DEV=modem
</PRE>
<!-- END CODE SNIP //-->
<P>You can use the word modem if you've created a symbolic link. However, if you have
Linux set up to answer incoming calls for logins, you should use the actual name of the
device—for example, cua1. The next section to check is the type of faxing your modem supports:
</P>
<!-- CODE SNIP //-->
<PRE>
# CLASS=1
CLASS=2
# CLASS=2.0
</PRE>
<!-- END CODE SNIP //-->
<P>Comment or uncomment the proper support by using the octothorpe, or pound
character (#), but make sure that only one CLASS is listed. After this, you'll want to customize
your faxes with your phone number:
</P>
<!-- CODE //-->
<PRE>
# Use only digits, spaces, and the "+" character.
FROM="0 000 000 0000"
# Your name as it should appear on the page header.
NAME="from a Red Hat Linux system"
</PRE>
<!-- END CODE //-->
<P>Enter your phone number, such as "1 202 555 1212," and name, such as
"Catherine Taulbee," into the these strings. Finally, you'll want to set the default page size for
faxing—for example,
</P>
<!-- CODE SNIP //-->
<PRE>
PAGE=letter
# PAGE=legal
# PAGE=a4
</PRE>
<!-- END CODE SNIP //-->
<P>Comment or uncomment the different page sizes, but use only one. After you finish
making
</P>
<A NAME="PAGENUM-152"><P>Page 152</P></A>
<P>
your changes, you should try the fax command to test your configuration and modem
by using the test command-line option—for example,
</P>
<!-- CODE //-->
<PRE>
# fax test
--------------------------------------
Please wait, this will take a minute...
--------------------------------------
-- /usr/bin/fax --
FAX=/usr/bin/fax
EFAX=/usr/bin/efax
EFIX=/usr/bin/efix
DEV=cua1
CLASS=2
...
</PRE>
<!-- END CODE //-->
<P>You'll get a three-page listing of information about your configuration, and your
modem's response to the fax script's queries. If you'd like to see this information at your
leisure, redirect the output of the text to a file—for example,
</P>
<!-- CODE SNIP //-->
<PRE>
# fax test > faxtest.txt
</PRE>
<!-- END CODE SNIP //-->
<P>You can then read about any error messages or problems with missing software.
Assuming that everything is OK, you can then try faxing a document by using the
fax command:
</P>
<!-- CODE SNIP //-->
<PRE>
# fax send -l 12025551212 faxtest.txt
</PRE>
<!-- END CODE SNIP //-->
<P>This tells the fax program to send a low-resolution, or 98 lines per inch, fax by using
the fax testing information you created. To send a high-resolution fax, no option is
needed—for example,
</P>
<!-- CODE //-->
<PRE>
# fax send 7201945 faxtest.txt
faxtest.txt is text...
/usr/bin/efax: Thu Dec 04 16:29:14 1997 efax v 0.8a Copyright 1996 Ed Casas
efax: 29:14 opened /dev/cua1
efax: 29:16 dialing T7201945
efax: 29:52 connected
efax: 29:59 session 196lpi 9600bps 8.5"/215mm 11"/A4 1D - - 0ms
efax: 29:59 header:[97/12/04 16:29 William H. Ball (+657 0210)
Â--> 7201945 p. 1/4]
efax: 30:32 sent 20+2156 lines, 38848+0 bytes, 33 s 9417 bps
efax: 30:35 sent -> faxtest.txt.001
efax: 30:36 header:[97/12/04 16:29 William H. Ball (+657 0210)
Â--> 7201945 p. 2/4]
efax: 30:54 sent 20+2156 lines, 20854+0 bytes, 18 s 9268 bps
efax: 30:57 sent -> faxtest.txt.002
efax: 30:58 header:[97/12/04 16:29 William H. Ball (+657 0210)
Â--> 7201945 p. 3/4]
</PRE>
<!-- END CODE //-->
<P><CENTER>
<a href="0145-0148.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0153-0156.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -