i.etcrpc 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
#
#
# Copyright 1994-2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
PATH="/usr/bin:/usr/sbin:${PATH}"
export PATH
while read src dest
do
if [ ! -f $dest ] ; then
cp $src $dest
else
#
# determine whether existing /etc/rpc file is based on
# the same one being installed. If so, no need to update it.
#
newrev=`sed -n 's/^.*\(@(#)rpc.*\)\".*/\1/p' $src`
oldrev=`sed -n 's/^.*\(@(#)rpc.*\)\".*/\1/p' $dest`
if [ "$oldrev" != "$newrev" ] ; then
grep '^#ident[ ]*\"@(#)rpc' $src \
> /tmp/newident.$$ 2>/dev/null
grep -v '^#ident[ ]*\"@(#)rpc' $dest \
> /tmp/rest.$$ 2>/dev/null
cat /tmp/newident.$$ /tmp/rest.$$ > $dest
rm -f /tmp/newident.$$ /tmp/rest.$$
fi
# add the entry for nispasswd used by rpc.nispasswdd
# even if sccsid is wrong it might still be there
# we do not get fancy and try to add it at the "right"
# location. putting it on the end works just fine.
grep 'nispasswd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'nispasswd 100303 rpc.nispasswdd' >> $dest
fi
# Add solstice admind entry
grep '100087' $dest > /dev/null 2>&1
if [ $? -eq 0 ] ; then
sed 's/.*100087.*/sadmind 100232/' $dest > /tmp/r.$$
cp /tmp/r.$$ $dest
rm -f /tmp/r.$$
fi
# Add nfs_acl entry
grep 'nfs_acl' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'nfs_acl 100227' >> $dest
fi
# Delete beta ufsd entry
grep 'ufsd[ ]*100999[ ]*ufsd' $dest >/dev/null 2>&1
if [ $? -eq 0 ] ; then
grep -v 'ufsd[ ]*100999[ ]*ufsd' $dest \
>/tmp/etcrpc.$$ 2>/dev/null
cp /tmp/etcrpc.$$ $dest
rm -f /tmp/etcrpc.$$
fi
# Add ufsd entry
grep 'ufsd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'ufsd 100233 ufsd' >> $dest
fi
# Delete amiserv entry
grep 'amiserv[ ]*100146' $dest >/dev/null 2>&1
if [ $? -eq 0 ] ; then
grep -v 'amiserv[ ]*100146' $dest \
>/tmp/etcrpc.$$ 2>/dev/null
cp /tmp/etcrpc.$$ $dest
rm -f /tmp/etcrpc.$$
fi
# Delete amiaux entry
grep 'amiaux[ ]*100147' $dest >/dev/null 2>&1
if [ $? -eq 0 ] ; then
grep -v 'amiaux[ ]*100147' $dest \
>/tmp/etcrpc.$$ 2>/dev/null
cp /tmp/etcrpc.$$ $dest
rm -f /tmp/etcrpc.$$
fi
# Add ocfserv entry
grep 'ocfserv' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'ocfserv 100150' >> $dest
fi
# Add metad entry
grep 'metad' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'metad 100229 metad' >> $dest
fi
# Add metamhd entry
grep 'metamhd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'metamhd 100230 metamhd' >> $dest
fi
# Add metamedd entry
grep 'metamedd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'metamedd 100242 metamedd' >> $dest
fi
# Add smserverd entry
grep 'smserverd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'smserverd 100155 smserverd' >> $dest
fi
# Add gssd entry
grep 'gssd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'gssd 100234' >> $dest
fi
# Add ktkt_warnd entry
grep 'ktkt_warnd' $dest > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo 'ktkt_warnd 100134' >> $dest
fi
fi
done
exit 0