Script-only dialup scripts anybody?

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Mon Jan 3 07:39:50 UTC 2005


  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.

  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.

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
An infinite number of monkeys pounding away on keyboards will
eventually produce a report showing that Windows is more secure,
and has a lower TCO, than linux.
--
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