NAME
at, drain, expect, pass – dialer scripting tools |
SYNOPSIS
dial/at [ –q ] [ –t seconds ] atcommand dial/expect [ –iq ] [ –t seconds ] goodstring [ badstring... ] dial/drain dial/pass [ –q ] |
DESCRIPTION
These commands are used to write telephone dialing scripts, mostly
for PPP sessions. They all expect standard input and output to
be connected to a communications device, e.g, a serial line to
a modem. They communicate with the user using /dev/cons.
At sends atcommand to the modem prefixed with the string at. It
then reads from the modem expecting an AT response. At will return
success if it gets and OK of CONNECT response. Otherwise it will
return the response as an error status. The options are:
Expect reads standard input looking for one of the strings given
as arguments. Reading the first string causes a successful exit
status. Reading any of the others causes an exit status equal
to the string. The command also terminates on a timeout. The options
are: Pass copies input from /dev/cons to standard output. It terminates on a newline. The only flag is –q and means the same as it does for expect.
Drain discards any input waiting on standard input. It is used
to sync up the stream at the start of dialing or after an error. |
EXAMPLE
The following rc script dials out through a Hayes compatible modem
on /dev/eia1 and lets the user type in a user name and password
before starting ppp. #!/bin/rc dev=/dev/eia1 telno=18005551212 fn initfn {
fn dialfn {
{
|
FILES
/rc/bin/ipconf/* example dialer scripts for ppp |
SOURCE
/sys/src/cmd/dial/*.c |
SEE ALSO
ppp(8), telco(4) |