home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sberbank.sumy.ua
/
2014.11.ftp.sberbank.sumy.ua.tar
/
ftp.sberbank.sumy.ua
/
incoming
/
sxtech
/
eq_update.sh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
2014-08-29
|
4KB
|
174 lines
#!/bin/sh
# Copyright 1999-2003 Coyote Point Systems Inc.
# All Rights reserved.
# $Revision: #4 $
# eq_update.sh
# Update Equalizer firmware
#
dosnmp=""
reboot=""
batch=""
keys=""
clear=""
lic=""
dash_b=0
gui=""
dash_G=0
upgrade_fw=""
args=$(getopt 'bkCGl' $*)
errcode=$?
set -- $args
for i; do
case "$i" in
-b)
batch='-b'
dash_b=1
;;
-k)
keys='-k'
;;
-C)
clear='-C'
;;
-l)
lic='-l'
;;
-G)
gui='-G'
dash_G=1
echo 'x' > /var/tmp/eq_upgrade.in
exec 1>>/var/log/eq_upgrade.log
;;
esac
done
case $(id -u) in
0)
;;
*)
echo This script must be run as root.
exit 1
;;
esac
echo
echo Equalizer upgrade - Product: *combined* Version: 8.6.0
echo
echo This script will upgrade the Equalizer software on this platform
echo to the above revision.
echo
echo
echo Do not interrupt while in progress. Upon completion the
echo Equalizer must be rebooted.
echo
echo "************* Note: SSH v1 has login support has been disabled"
echo "************* beginning with Equalizer software version 8.5."
echo
echo "************* Note: All FDISK slices other than the current"
echo "************* active ones will be deleted."
echo
/usr/bin/perl -w -mCarp ./check_sw_fw.pl $gui
if [ $? != 0 ] ; then
upgrade_fw='-F'
fi
if [ $dash_b != 0 ] ; then
echo -n 'Proceed? [y/n] '
echo ' YES'
ans="y"
else
if [ $dash_G != 0 ] ; then
echo 'Proceed? [y/n]'
ans='x'
while [ "$ans" = "x" ]; do
sleep 1
read ans < /var/tmp/eq_upgrade.in
done
echo 'x' > /var/tmp/eq_upgrade.in
else
echo -n 'Proceed? [y/n] '
read ans
fi
fi
if [ "$ans" = "Y" ]; then # smash case so we take either 'Y' or 'y'
ans="y"
fi
if [ "$ans" != "y" ]; then
echo Aborting upgrade.
if [ $dash_G = 0 ] ; then
echo Run this script from this directory
echo at a later time to update Equalizer
fi
echo abort >> /var/log/eq_update.log
exit 1
fi
reboot="";
plat=$(lm -p)
hw=$(lm -h | awk '{ print substr($0, 0, 6) }')
if [ "$plat" = "e450" -o "$plat" = "e550" -o "$plat" = "e650" ]; then
dosnmp="-S"
fi
# The 350gx gets an SNMP license
if [ "$hw" = "e350gx" ]; then
dosnmp="-S"
fi
#
# Likewise, if SNMP is already installed then we automatically
# install it. This is for some special case customers who have
# licensed SNMP but are not using e450s.
#
if [ -e /var/eq/snmpd.cnf ]; then
dosnmp="-S"
fi
if [ "$ans" = "SNMP" ]; then
echo "WARNING: You have specified installation of the SNMP agent and"
echo "subagent. Please be aware that these components are provided"
echo "only to authorized licensees. If you are uncertain about your"
echo "license status, please contact Coyote Point at +1(408)291-5240"
echo "or email info@coyotepoint.com. If you are licensed to install"
echo "SNMP, type 'y' below, otherwise please type 'n'."
if [ $dash_G != 0 ] ; then
echo "Continue installing SNMP? [y/n]"
ans='x'
while [ "$ans" = "x" ]; do
sleep 1
read ans < /var/tmp/eq_upgrade.in
done
echo 'x' > /var/tmp/eq_upgrade.in
else
echo -n "Continue installing SNMP? [y/n]"
read ans
fi
if [ "$ans" = "y" -o "$ans" = "Y" ]; then
dosnmp="-S"
fi
fi
#
# If we're not installing snmp, then remove the tarball from the system right now.
#
if [ ! "$dosnmp" ]; then
[ -e ./snmp.tgz ] && rm ./snmp.tgz
fi
/usr/bin/perl -w -mCarp /usr/l7up/l7up.pl -X
/usr/bin/perl -w -mCarp /usr/l7up/l7up.pl $batch $keys $dosnmp $reboot $clear $gui $upgrade_fw $lic