#===========================================================================
# File Name :     agr_auxinst
#
# Copyright (c) 2003, 2004, 2006 Agere Systems, Inc.  All rights reserved.
#
# Description:
#  This script helps installation of Agere Soft Modem driver modules in RPM
#  packages.
#
# Revision History:
#   Name                   Date          Change
#   Soumyendu Sarkar       06/22/2003    Initial
#===========================================================================
#!/bin/sh

group="uucp"
mode="666"

device="/dev/ttyAGS3"

case "$1" in

  copy)
  echo "Copying installation components to /usr/lib/AgereSoftModem"
  echo "Usage of Agere Softmodem driver is subject to acceptance of EULA as stated in /usr/lib/AgereSoftModem/LICENSE"
  echo ""
  cat ./LICENSE

  if [ -e ./agrmodem.ko ] && [ -e ./agrserial.ko ] && [ -d /usr/lib/ ]
  then
	if [ -d /usr/lib/AgereSoftModem ]
  	then
      		:
  	else
	    mkdir /usr/lib/AgereSoftModem; \
  	fi
    if [ -d /usr/lib/AgereSoftModem ]
    then

      cp ./agrinst /usr/lib/AgereSoftModem; \
      cp ./agruninst /usr/lib/AgereSoftModem; \
      cp ./agr_softmodem /usr/lib/AgereSoftModem; \
      cp ./agrmodem.ko /usr/lib/AgereSoftModem; \
      cp ./agrserial.ko /usr/lib/AgereSoftModem; \
      cp ./LICENSE /usr/lib/AgereSoftModem; \
      cp ./README /usr/lib/AgereSoftModem; \
      cp ./AgereMdmDaemon /usr/lib/AgereSoftModem; 2>/dev/null; \
    else

      echo "folder creation error /usr/lib/AgereSoftModem"

    fi
  else

      echo "driver modules not present"

  fi
	;;

  *)
	echo "Usage: agr_auxinst {copy}"
	exit 1
esac

exit 0
