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...