Script-only dialup scripts anybody?
William Park
opengeometry-FFYn/CNdgSA at public.gmane.org
Mon Jan 3 08:14:28 UTC 2005
On Mon, Jan 03, 2005 at 02:39:50AM -0500, Walter Dnes wrote:
> Just in case this has been done before, I don't want to end up
> re-inventing the wheel. It seems that the "wvdial" dialer is turning
> into another fat, bloated example of "abject ornamentation".
>
> First of all, let's remember that the goal of a dialer is to read a
> config file, dial in to the ISP, and set up a connection... period...
> end of story. wvdial *REQUIRES* the wvstreams library, which in turn
> *REQUIRES* XPLC (yet *ANOTHER* "platform-independant component library",
> like whoopeeeeeee). wvstreams will compile, but it complains bitterly
> about the not finding pam, famd, speex, ogg vorbis, and various other
> stuff that has absolutely nothing whatsoever to do with dialing my local
> ISP and setting up an ordinary PPP connection. Normally this additional
> stuff would be pulled in, but the Gentoo "USE" variable gives me the
> power to block it. With crummy programming like this, you'll understand
> why linux, which used to run comfortably in 32 megs of RAM some years
> ago, now wants 256 megs, and preferably 512. Yes, I'm running OK in
> 128, but I have to over-ride the standard config a lot.
My sympathies...
>
> I'm annoyed enough about this that I want to replace wvdial with a
> bash script. Basically, you're talking to the modem. Here's what I've
> done so far. Start off with the config file, which contains the user's
> ISP info. It's specific to each user. Let's call it my_isp.conf
>
> # Start initialization
> userid='my_userID'
> password='my_password'
> dialstring='ATDT5555551234'
> modeminit1='ATZ'
> modeminit2='ATQ0 V1 E1 L0 S0=0 &C1 &D2'
> modemdevice='/dev/ttyS4'
> # End of initization
>
> Next is the "dialup" script. It would be invoked as...
> dialup my_isp.conf
>
> The script so far is...
>
> #!/bin/bash
> # Source the user-specific stuff
> . ${1}
>
> echo "${modeminit1}" > ${modemdevice}
> sleep 6
> echo "${modeminit2}" > ${modemdevice}
> sleep 6
> echo "${dialstring}" > ${modemdevice}
> sleep 15
> echo "${userid}" > ${modemdevice}
> sleep 5
> echo "${password}" > ${modemdevice}
>
> I presume that pppd has to be launched here. I'm not familiar with
> how pppd works, which is why I'm asking for help with the syntax here.
> The user would probably need to be listed in sudoers as being eligible
> to run this script. bash has a "read" construct that can read lines of
> text from a file, and linux allows us to treat modems as files. This
> would allow a smarter script that waits for the logon and password
> prompts, and responds to them.
Although doable, there is no need for Bash script. In my Slackware-9.1
machine, there is 'ppp-2.4.1' package which contains 'chat' which will
talk with the modem. I can only assume that it's part of standard
ppp-2.4.1 software. So, download the latest 'ppp' source, and compile.
--
William Park <opengeometry-FFYn/CNdgSA at public.gmane.org>
Open Geometry Consulting, Toronto, Canada
Linux solution for data processing.
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list