
#  Copyright (C) 1984 - 1994 by 
#  Digital Equipment Corporation, Maynard, Mass.
# 
#  This software is furnished under a license and may be used and copied
#  only  in  accordance  with  the  terms  of such  license and with the
#  inclusion of the above copyright notice. This software or  any  other
#  copies thereof may not be provided or otherwise made available to any
#  other person. No title to and ownership of  the  software  is  hereby
#  transferred.
# 
#  The information in this software is subject to change without  notice
#  and  should  not be  construed  as  a commitment by Digital Equipment
#  Corporation.
# 
#  Digital assumes no responsibility for the use or  reliability  of its
#  software on equipment which is not supplied by Digital.
# 
#  Abstract: This is a shell script file to automate the installation of 
#            the management software 
# 
# 

if test -d /digital/snmp
then  
   echo "/digital/snmp directory exits already..."
   cd /digital/snmp   
   echo "Go to `pwd` directory ..."
else
   echo "/digital/snmp directory does not exist ..."
   echo "/digital/snmp directory is being created now ... "   
   mkdir /digital
   cd /digital   
   mkdir snmp
   cd snmp
   echo "Creating `pwd` successfully ..."   
fi
echo
echo "Copying files from DOS-Disk ..."
doscp -v /dev/fd0:/SNMP/SCO/SNMP.TZ /digital/snmp/snmp.tar.Z  
uncompress snmp.tar.Z
tar xf snmp.tar
rm snmp.tar

echo "Looking for /etc/snmpd.peers file ..."
if test -f /etc/snmpd.peers 
then 
   echo "/etc/snmpd.peers file does exist ..." 
   echo 
   echo "Looking for entries in the /etc/snmpd.peers ..."
   echo 
else 
   echo "Warning: /etc/snmpd.peers not found ...Please install properly"
   echo "Installation terminated ..."
   exit 
fi

string1=`grep "rfc1643" /etc/snmpd.peers`
if test "$string1" = "" ;then
  echo 'Adding "rfc1643" entry into /etc/snmpd.peers ...' 
  echo '#Digital Equipment Corporation MIB-Entries' >> /etc/snmpd.peers
  echo '"rfc1643"      1.3.6.1.2.1.10.7     "mypasswd"' >> /etc/snmpd.peers  
else
  echo "$string1"
  echo "Entry exists in /etc/snmpd.peers already ... no addition!"
  echo
fi

string2=`grep "rfc1514" /etc/snmpd.peers`
if test "$string2" = "" ;then
  echo 'Adding "rfc1514" entry into /etc/snmpd.peers ...'   
  echo '"rfc1514"      1.3.6.1.2.1.25.3     "mypasswd"' >> /etc/snmpd.peers  
else 
  echo "$string2"
  echo "Entry exists in /etc/snmpd.peers already ... no addition!"
  echo
fi  
