3 at, drain, expect, pass \- dialer scripting tools
33 These commands are used to write telephone dialing
34 scripts, mostly for PPP sessions. They all expect standard input and
35 output to be connected to a communications device, e.g,
36 a serial line to a modem. They communicate with the user using
42 to the modem prefixed with the string
44 It then reads from the modem expecting an AT response.
46 will return success if it gets and
50 response. Otherwise it will return the response as an
51 error status. The options are:
61 what is read from standard in. The default is
62 to copy everything through.
66 reads standard input looking for one of the strings given
67 as arguments. Reading the first string causes a successul exit
68 status. Reading any of the others causes an exit status equal to
69 the string. The command also terminates on a timeout. The options
78 ignore case when doing the matches.
83 what is read from standard in. The default is
84 to copy everything through.
91 It terminates on a newline. The only flag is
93 and means the same as it does for
97 discards any input waiting on standard input. It
98 is used to sync up the stream at the start of dialing
103 script dials out through a Hayes compatible modem on
105 and lets the user type in a user name and password
125 if( test -e $dev^ctl ){
127 echo -n m1 # cts/rts flow control
128 echo -n q64000 # big buffer
129 echo -n n1 # nonblocking writes
132 echo -n c1 # handup when we lose dcd
135 # get the modem's attention
143 if( ! dial/expect -it 60 'username:' ){
144 echo can''t connect >[1=2]
148 if( ! dial/expect -it 60 'password:' ){
149 echo can''t connect >[1=2]
153 if( ! dial/expect -t 60 'ppp or telnet:' ){
154 echo can''t connect >[1=2]
158 dial/expect -t 5 something
159 echo connected >[1=2]
167 example dialer scripts for ppp
169 .B /sys/src/cmd/dial/*.c