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