postinstall revision 0ea5e3a571e3da934507bdd32924d11659c70704
347N/A#
347N/A# CDDL HEADER START
347N/A#
347N/A# The contents of this file are subject to the terms of the
347N/A# Common Development and Distribution License (the "License").
347N/A# You may not use this file except in compliance with the License.
347N/A#
347N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
347N/A# or http://www.opensolaris.org/os/licensing.
347N/A# See the License for the specific language governing permissions
347N/A# and limitations under the License.
347N/A#
347N/A# When distributing Covered Code, include this CDDL HEADER in each
347N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
347N/A# If applicable, add the following below this CDDL HEADER, with the
347N/A# fields enclosed by brackets "[]" replaced with your own identifying
347N/A# information: Portions Copyright [yyyy] [name of copyright owner]
347N/A#
347N/A# CDDL HEADER END
347N/A#
347N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
347N/A# Use is subject to license terms.
347N/A#
347N/A# ident "%Z%%M% %I% %E% SMI"
347N/A
347N/A#
347N/A# pkgdefs/SUNWsacom/postinstall
347N/A#
347N/A
347N/A#
347N/A# Retain original SNMPD configuration file they might have from an
347N/A# earlier SunNet Manager installation.
493N/A#
347N/A
347N/Aif [ -f $BASEDIR/etc/opt/SUNWconn/snm/snmpd.conf ] ; then
347N/A cp $BASEDIR/etc/snmp/conf/snmpd.conf $BASEDIR/etc/snmp/conf/snmpd.conf.original
493N/A echo 'Copying $BASEDIR/etc/opt/SUNWconn/snm/snmpd.conf (existing SNMPD configuration file)'
347N/A echo 'to $BASEDIR/etc/snmp/conf/snmpd.conf'
347N/A cp $BASEDIR/etc/opt/SUNWconn/snm/snmpd.conf $BASEDIR/etc/snmp/conf/snmpd.conf
493N/Afi
347N/A
347N/Adef_read="public"
347N/Adef_write="private"
347N/Adef_desc="Sun SNMP Agent, Company Property Number 123456"
347N/Adef_cont="System administrator"
347N/Adef_loc="System administrators office"
493N/A
493N/AREADSTR=$def_read
347N/AWRITESTR=$def_write
347N/A
desc=`/etc/prtconf |/usr/bin/head -5|/usr/bin/grep SUNW |awk -F, '{print $2}'`
if [ "$desc" = "" ]; then
desc=`/etc/prtconf |/usr/bin/head -5|/usr/bin/grep SUNW |awk '{print $1}'`
fi
def_desc="Sun SNMP Agent, $desc"
DESCSTR=$def_desc
CONTSTR=$def_cont
LOCSTR=$def_loc
export READSTR WRITESTR DESCSTR CONTSTR LOCSTR
# main ()
#
# Update the snmpd.conf file with the default community strings
# for the system on which this is installed.
#
/usr/bin/ed -s $BASEDIR/etc/snmp/conf/snmpd.conf <<SNMPEOF>/dev/null
1,\$s!ALLDESC!$DESCSTR!g
1,\$s!ALLCONT!$CONTSTR!g
1,\$s!ALLLOC!$LOCSTR!g
w
q
SNMPEOF
installf -f $PKGINST
#
# check if snmpdx should be enabled (snmpdx.tmp was set in preinstall)
if [ -f $BASEDIR/var/snmpdx.tmp ]; then
cat >> $BASEDIR/var/svc/profile/upgrade <<\_SNMPDX
if [ `/sbin/zonename` = global ]; then
/usr/sbin/svcadm enable svc:/application/management/snmpdx:default
fi
_SNMPDX
rm -f $BASEDIR/var/snmpdx.tmp
fi
exit 0