#!/bin/sh
#Barry Kauler, LGPL 2007
#called from rc.local0. note, rc.local0 calls rc.modem beforehand which
#sets /dev/modem if a hardware modem found (otherwise /dev/modem deleted).

#if a modem found, quit...
[ -e /dev/modem ] && exit

[ ! $1 ] && exit
[ "$1" != "start" ] && exit

if [ "`lsmod | grep '^ltserial'`" != "" ];then
 ln -snf ttyLT0 /dev/modem
fi

#the module doesn't seem to support any country setting, so...
if [ -f /etc/countryinfo ];then
 SPATTERN="s/^MODEM_COUNTRY_STRING.*/MODEM_COUNTRY_STRING=''/"
 cat /etc/countryinfo | sed -e "$SPATTERN" > /tmp/countryinfo
 sync
 mv -f /tmp/countryinfo /etc/countryinfo
fi
#.../usr/sbin/gen_modem_init_string reads this variable (called from second
#entry to /etc/rc.d/rc.modem, in rc.local0).


###END###
