#!/bin/sh
#Barry Kauler, LGPL 2008
#called from rc.services.
#note, when the modules agrmodem.ko and agrserial.ko load, they create
#/dev/ttyAGS3 if it does not already exist.

#if a different modem selected, quit... v405...
[ -h /dev/modem ] && [ "`readlink /dev/modem`" != "ttyAGS3" ] && exit

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

if [ "`lsmod | grep '^agrserial'`" != "" ];then
 ln -snf ttyAGS3 /dev/modem
 [ ! -e /dev/ttySAGR ] && ln -s ttyAGS3 /dev/ttySAGR
 #...i think wvdialconf looks for /dev/ttySAGR
fi

#docs have this comment for agrsm...
## Outside the USA, a country setting may be needed
# Init3 = AT+CGI=hexadecimal_country_code

#future: write /etc/countryinfo, with MODEM_COUNTRY_STRING
#.../usr/sbin/gen_modem_init_string reads this variable (called from second
#entry to /etc/rc.d/rc.modem, in rc.local0).


###END###
