# esxi_ovftool_install_8

ls -lah /vmfs/volumes
datastore="/vmfs/volumes/62b06be1-865775eb-0dcd-e43d1a61f9cc"
cd $datastore
#ovftoolLink="https://files.jezz.systems/etc/ovftool6.tar"
#ovftoolLink="https://files.jezz.systems/etc/ovftool7.tar"
 ovftoolLink="https://files.jezz.systems/etc/ovftool8.tar"
esxcli network firewall ruleset set -e true -r httpClient
wget --no-check-certificate $ovftoolLink
esxcli network firewall ruleset set -e false -r httpClient
esxcli system settings advanced list -o /User/execInstalledOnly
esxcli system settings advanced set -o /User/execInstalledOnly -i 0
esxcli system settings advanced list -o /User/execInstalledOnly
mkdir $datastore/ovftool
tar -xvf $datastore/ovftool*.tar -C $datastore/ovftool
chmod -R 777 ./ovftool
chmod +x ./ovftool/ovftool
      alias ovftool=$datastore/ovftool/ovftool
echo "alias ovftool=$datastore/ovftool/ovftool">>/etc/profile.local
rm $datastore/ovftool*.tar

# esxi_ovftool_install_8_notes

DS="/vmfs/volumes/6a68e34f-783e2391-a7b2-0894ef33d76a"
DEST="$DS/ovftool8"
OVF="$(find "$DEST" -type f -name ovftool | head -n 1)"
OVFBIN="$(find "$DEST" -type f -name ovftool.bin | head -n 1)"
echo "Wrapper: $OVF"
echo "Binary:  $OVFBIN"
chmod 755 "$OVF"
chmod 755 "$OVFBIN"
#sed -i '1s|^#!/bin/bash|#!/bin/sh|' "$OVF"
"$OVF" --version
      alias ovftool=$OVF
echo "alias ovftool=$OVF">>/etc/profile.local
