VMware Cloud Community
tdubb123
Expert
Expert

post install script to check version

I got this post install script that I want to check the version of esx. if its 5, then do A. if its 4 then do B.

# Check for which version of esx
$version = "vmware -v"
if [$version -eq "VMware ESXi 5.0.0 build-504890"]
then
......
elif [v -eq "VMware ESXi 4.1.0 build-502767"]
then
how do I fix this?
0 Kudos
1 Reply
tdubb123
Expert
Expert

how do I fix this post install script?

cd /tmp
# Check for which version of esx
vmware -v > version
if [$version -eq "VMware ESXi 5.0.0 build-504890"]
then
# Download Brocade HBA Drivers
echo "Downloading Brocade HBA Drivers..."
for zipfile in `ls *.zip`; do
esxcli software vib install --depot=/tmp/BCD-bfa-3.0.1.0-00000-offline_bundle-503860.zip
done
elif [$version -eq "VMware ESXi 4.1.0 build-502767"]
then
echo "Downloading Brocade HBA Drivers..."
1.zip
for zipfile in `ls *.zip`; do
esxupdate --bundle=/tmp/BRCD-bfa-3.0.0.0-00000-offline_bundle-468461.zip update
done
fi
0 Kudos