# modem_in
# ID 6.1 96/12/11
#
# This purpose of this script is to change a modem port configured to be
# outgoing (for VSI*FAX) to be incoming (i.e. a diagnostic modem for support).
#
# You must be root to run this script.  
#
# -----------------------------------------------------------------------------
# CHANGE HISTORY SECTION :
#  Rel#    Date                    Description
#  ----- --------   -----------------------------------------------------------
#  5.2.0 09/07/95   Created.
#  5.3.0 02/08/96   SPR#003043 - Modified to not send "AT" command to modem.
#  5.3.0            Also modified to make scripts compatible with AIX 4.x.
#  5.3.0 03/13/96   Modified to not start the fax scheduler in this script.
#  5.3.0            The faxmenu script will start the scheduler instead.
#  5.3.0 04/02/96   SPR#003043 - Modified to make compatible with AIX 4.x.
#  5.3.0 11/08/96   SPR#003904 - Modified to make compatible with SCO UNIX.
# -----------------------------------------------------------------------------
#
# Depending on the port being used for the modem, you must edit the line
# beginning with the "cat" command, and the lines beginning with the "chdev -l"
# command to reflect the desired port.
#  Examples:
#          -- modem connectted to /dev/tty00 on a VS/95 --
#   cat $INITTAB | sed s';^t0:.*;t0:23:respawn:/etc/getty tty00 19200F;' \
#     > $INITTAB2
#          -- modem connectted to /dev/tty01 on a VS/95 --
#   cat $INITTAB | sed s';^t1:.*;t1:23:respawn:/etc/getty tty01 19200F;' \
#     > $INITTAB2
#          -- modem connectted to /dev/ttyA4 on a VS/95 --
#   cat $INITTAB | sed s';^A4:.*;A4:23:respawn:/etc/getty /dev/ttyA4 19200F;' \
#     > $INITTAB2
#          -- modem connectted to tty4 on a VS/R --
#   chdev -l 'tty4' -a login='enable' \
#   chdev -l 'tty4' -a runmodes='cread,brkint,icrnl,opost,\
# ----------------------------------------------------------------------------
#
# Do not run this script until it has been edited to reconfigure the
# desired port.  Comment out the following three lines once the script 
# has been modified.
#
#echo "This script can not be run until it has been modified to select the"
#echo "port to be reconfigured.  Please modify the script accordingly."
#exit 0
#
# ----------------------------------------------------------------------------
#
case "$VAE_UNIX" in
SVR3)
    INITTAB="/etc/inittab"
    INITTAB1="/etc/inittab.orig"
    INITTAB2="/etc/inittab2"
    cp $INITTAB $INITTAB1     #save a copy of inittab in inittab.orig
    cat $INITTAB | sed s';^t0:.*;t0:23:respawn:/etc/getty tty00 19200F;' \
      > $INITTAB2
    cp $INITTAB2 $INITTAB
    init q
;;
SCO)
  INITTAB="/etc/inittab"
  INITTAB1="/etc/inittab.orig"
  INITTAB2="/etc/inittab2"
  cp $INITTAB $INITTAB1     #save a copy of inittab in inittab.orig
  cat $INITTAB | sed s';^A04:.*;A04:23:respawn:/etc/getty /dev/ttyA04 19200;' \
    > $INITTAB2
  cp $INITTAB2 $INITTAB
  init q
;;
AIX)
chdev -l 'tty12' -a runmodes='cread,brkint,icrnl,opost,\
tab3,onlcr,isig,icanon,echo,echoe,echok,echoctl,echoke,imaxbel,iexten,hupcl'
chdev -l 'tty12' -a login='enable'
;;
*)
    echo "This script does not work for the platform you are on."
    echo "Please re-configure the modem manually."
    exit 0
;;
esac
#
