#!/bin/ksh
################################################################################
# Name: /IBM/bin/lcmaSNMP
# Purpose: script to initiate the lcma utility through SNMP, including the
#          ability to NFS mount the server to access the IDF/SDF
################################################################################

LCMACMD=`echo $@ | cut -f1 -d" "`

NFSNEEDED=`echo $2 | cut -c1-7`
if [ $NFSNEEDED = "file://" ]; then
	NFS=`echo $2 | cut -c8-`
	mount $NFS /mnt/update
	LCMAPARMS=`echo $@ | cut -f3- -d" "`
else
	LCMAPARMS=`echo $@ | cut -f2- -d" "`
fi

# Initiate the lcma utility
$LCMACMD $LCMAPARMS

# Unmount the server if necessary
if [ $NFSNEEDED = "file://" ]; then
	umount /mnt
fi

echo "$*" > /tmp/snmp/71
