#===========================================================================
# File Name :     agr_softmodem
#
# Copyright (c) 2002, 2003, 2004 Agere Systems, Inc.  All rights reserved.
#
# Description:
#  Service script for Agere Soft Modem driver modules
#  This script is linked to various run levels and will be run when the system
#  boots up or shuts down. 
#
# Revision History:
#   Name                   Date          Change
#   Soumyendu Sarkar       12/03/2002    Initial
#===========================================================================
#!/bin/sh
### BEGIN INIT INFO
# Provides: agrsm
# Default-Start: 3 5
# Description: Start Agere Systems Soft Modem
### END INIT INFO

group="uucp"
mode="666"

device="/dev/ttyAGS3"

case "$1" in

  start)
  echo "Starting Agere Soft Modem"
  
  /sbin/modprobe agrmodem
  /sbin/modprobe agrserial
 /usr/lib/AgereSoftModem/AgereMdmDaemon
 
  if [ -e /dev/modem ]
  then
      :
  else
  ln -s $device /dev/modem
  fi
	;;

  stop)
  echo "Shutting down Agere Soft Modem"
 
  /sbin/rmmod agrserial; \
  /sbin/rmmod agrmodem; \
	;;

  restart|reload)
	$0 stop
	$0 start
	;;

  *)
	echo "Usage: agr_softmodem {start|stop|restart|reload}"
	exit 1
esac

exit 0
