View Single Post
Old 10th-March-2006, 01:21 AM   #3 (permalink)
ducasi
Lovely Moderator
 
ducasi's Avatar
 
Join Date: Feb 2005
Location: Glasgow
Posts: 9,728
Status: simply bushed!
Rep Power: 6 Rep.: 3365
ducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to beholdducasi is a splendid one to behold
Re: Linux: automatic modem configuration

Off the top of my head... a wee shell script in /etc/rc1.d/ or similar... Call it "S99.modem-config". (The "99" might need to be smaller to get this to run before the rest of the network stuff...)

(The proper way of doing this is to put the script in /etc/init.d/ and run update-rc.d, but I'm going to ignore that...)

Here's a quick hacked-up script...

Code:
#! /bin/sh -

# what we're talking to...
MODEM=/dev/ttya

exec >$MODEM <$MODEM

function echook() {
  echo "$@"
  sleep 2
  read a
  test "$a" == "OK"
}


while true
  do
    sleep 60
    echook "AT1111" || continue
    sleep 10
    echook "AT2222" || continue
    sleep 10
    echook "AT3333" || continue
    break
  done
Some tweaking, maybe a "stty" or two, but that is all that you really need...

Hope this helps...
__________________
Let your mind go and your body will follow. – Steve Martin, LA Story
ducasi is online now   Reply With Quote