From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] connecting to ISP with PAP? From: Richard Miller MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-gohyttsigivycnegjygrspmcdw" Message-Id: Date: Tue, 14 Nov 2000 21:27:28 +0000 Topicbox-Message-UUID: 2acb603c-eac9-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-gohyttsigivycnegjygrspmcdw Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit dhog@plan9.bell-labs.com says: > I'm personally getting quite sick of typing "atdt^M", (and > sometimes getting it wrong) and then having to participate in > further handshaking (and sometimes head-scratching) with my > ISP. Has anyone given any thought as to how this should be > automated? The "atdt^M" part can be automated by using -p telco!ispname if you trust telco (and if your /lib/ndb/local has a line like sys=ispname telco=555-1234). The further handshaking (if you need a login script for an isp which doesn't support CHAP or PAP) can be automated by persuading ip/ppp to call a command, in the manner of the -c option of con(1), instead of reading user input. You can use rc as a scripting language - below is my quickly thrown together script for logging into Compuserve (where 'cread -t N C' is a variant of read(1) which copies from stdin to stdout until either a character C is encountered or N seconds elapse). I could post the source for cread, and the change to ppp to call command scripts, but they're both pretty obvious. -- Richard --upas-gohyttsigivycnegjygrspmcdw Content-Type: message/rfc822 Content-Disposition: inline #!/bin/rc fn expect { x=`{cread -t $1 :}; echo got: $x >[1=2]; ~ $x *^$2^*} fn send { echo sent: $1 >[1=2]; echo $1 | tr '\12' '\15' } fn sendq { echo $1 | tr '\12' '\15' } fn readuntil { @{ while (x=`{cread -t 60 ' '}) { echo got: $x >[1=2]; if (~ $x *^$1^*) exit () } } } echo $0 running >[1=2] send '' while (! expect 10 ame:) {send ''} send CIS if (! expect 10 ID:) exit 'no ID prompt' send $host/GO:PPPCONNECT expect 60 GO: if (! expect 10 ord:) exit 'no password prompt' sendq $pass readuntil 'One moment please' --upas-gohyttsigivycnegjygrspmcdw--