installation script

上一篇 / 下一篇  2008-11-12 16:49:53 / 个人分类:Bash

#Run this scrīpt to install panorama silently. You have to run it as root user.
if [ "$(/usr/ucb/whoami)" != "root" ]; then
 echo "You must be root to execute this scrīpt." 2>&1
 exit 1
fi

if [ $# -ne 2 ]; then
 echo "Usage: $0 PanoramaVersion EMSType." 2>&1
 exit 1
fi

if [ "$2" != "ANSI" -a "$2" != "ETSI" ]; then
 echo "Usage: EMSType must be ANSI/ETSI." 2>&1
 exit 1
 else
   emsType=$2
fi

cd /
# Check whether ems link file exists
if [ ! -e "ems" ]; then
 echo "Lnks: ems not found. Please create a symbolic link named ems in root direcotry to Panorama installation directory." 2>&1
 exit 1
fi

emsVer="$1"
cd ems
emsDir="$(ls | grep "$emsVer")"
if [ "$emsDir" = "" ]; then
 echo "Lnks: Panorama directory of "$emsVer" in "$(pwd)" not found."  2>&1
 exit 1
fi

# Unzip tar file
cd $emsDir
emsTar="$(ls | grep "$emsVer")"
if [ "$emsTar" = "" ]; then
 echo "Lnks: Tar file of $emsVer in "$(pwd)" not found."  2>&1
 exit 1
fi
echo "Unzipping $emsTar..."
gunzip -c "$emsTar" | tar -xvf -
#rm "$emsTar"

# Kick emsadmin user
pkill -9 -u emsadmin

# Install paronama full
emsTypeFile="silentinstalloptions""$emsType"
cp ../"$emsTypeFile" .
./silent_install.sh "$emsTypeFile"

# Reboot
echo "Reboot..."
cd /
#sync;sync;/etc/shutdown -y -g0 -i6


相关阅读:

TAG: bash Bash

 

评分:0

我来说两句

日历

« 2024-04-27  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 47721
  • 日志数: 80
  • 建立时间: 2008-10-27
  • 更新时间: 2009-07-17

RSS订阅

Open Toolbar