i.dialers revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!/bin/sh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#ident "%Z%%M% %I% %E% SMI"
#
# Copyright (c) 1993 by Sun Microsystems, Inc.
#
while read src dest
do
if [ ! -f $dest ] ; then
cp $src $dest
else
# update version string
grep '^#ident[ ]*\"@(#)Dialers' $src \
> /tmp/newident.$$ 2>/dev/null
grep -v '^#ident[ ]*\"@(#)Dialers' $dest \
> /tmp/rest.$$ 2>/dev/null
cat /tmp/newident.$$ /tmp/rest.$$ > $dest
# add USR Courier entry
grep '^usrv32-ec[ ]' $dest > /dev/null 2>&1
if [ $? != 0 ] ; then
echo "" > /tmp/x.$$
sed -n '/#.*USR Courier/,/^usrv32-nec/p' $src >> \
/tmp/x.$$
#
# add it after the hayes entry if it exists,
# otherwise add it at the end.
#
grep '^hayes[ ]' $dest > /dev/null 2>&1
if [ $? = 0 ] ; then
sed "/^hayes[ ]/r /tmp/x.$$" $dest > \
/tmp/ex.$$
mv /tmp/ex.$$ $dest
else
cat /tmp/x.$$ >> $dest
fi
fi
# add Telebit T1600 entry
grep '^tb9600-ec[ ]' $dest > /dev/null 2>&1
if [ $? != 0 ] ; then
echo "" > /tmp/x.$$
sed -n '/#.*Telebit T1600/,/^tb9600-nec/p' $src >> \
/tmp/x.$$
grep '^tbfast[ ]' $dest > /dev/null 2>&1
#
# add it after the tbfast entry if it exists,
# otherwise add it at the end.
#
if [ $? = 0 ] ; then
sed "/^tbfast/r /tmp/x.$$" $dest > \
/tmp/ex.$$
mv /tmp/ex.$$ $dest
else
cat /tmp/x.$$ >> $dest
fi
fi
# update STTY of usrv32-ec
grep '^usrv32-ec[ ]' $dest | grep 'STTY=' |
grep -v 'crtsxoff' > /dev/null 2>&1
if [ $? = 0 ] ; then
sed "/^usrv32-ec[ ]/s/crtscts/crtscts,crtsxoff/" \
$dest > /tmp/x.$$
mv /tmp/x.$$ $dest
fi
# update STTY of usrv32-nec
grep '^usrv32-nec[ ]' $dest | grep 'STTY=' |
grep -v 'crtsxoff' > /dev/null 2>&1
if [ $? = 0 ] ; then
sed "/^usrv32-nec[ ]/s/crtscts/crtscts,crtsxoff/" \
$dest > /tmp/x.$$
mv /tmp/x.$$ $dest
fi
# update STTY of tb9600-ec
grep '^tb9600-ec[ ]' $dest | grep 'STTY=' |
grep -v 'crtsxoff' > /dev/null 2>&1
if [ $? = 0 ] ; then
sed "/^tb9600-ec[ ]/s/crtscts/crtscts,crtsxoff/" \
$dest > /tmp/x.$$
mv /tmp/x.$$ $dest
fi
# update STTY of tb9600-nec
grep '^tb9600-nec[ ]' $dest | grep 'STTY=' |
grep -v 'crtsxoff' > /dev/null 2>&1
if [ $? = 0 ] ; then
sed "/^tb9600-nec[ ]/s/crtscts/crtscts,crtsxoff/" \
$dest > /tmp/x.$$
mv /tmp/x.$$ $dest
fi
rm -f /tmp/*.$$
fi
done
exit 0