forked from DrDonk/esxi-unlocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check
executable file
·51 lines (40 loc) · 1.1 KB
/
check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# SPDX-License-Identifier: MIT
#set -e
#set -x
printf "VMware ESXi Unlocker 4.0.5\n"
printf "==========================\n"
printf "\nChecking unlocker...\n"
# Ensure we only use unmodified commands
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
ESXI=$(vmware -v)
printf "Current version of ESXi: $ESXI\n"
if [ ! -f "/etc/unlock.conf" ]; then
printf "System has not been patched\n"
exit 1
fi
PATCH=$(cat /etc/unlock.conf)
printf "Patch built for ESXi: $PATCH\n"
if [[ "$ESXI" != "$PATCH" ]]; then
printf "\x1B[41m\x1B[37m>>> ERROR: Mis-matched files please relock/unlock to update patches <<<\x1B[0m\n"
exit 1
fi
printf "Checking VMTAR loaded...\n"
esxcli system visorfs tardisk list | grep apple.v00 >/dev/null
if [[ $? == 0 ]]
then
printf "apple.v00 loaded\n"
else
printf "apple.v00 not loaded\n"
fi
printf "Checking vmx vSMC status...\n"
grep -il \(c\)AppleComputerInc /bin/vmx*
if [[ $? == 0 ]]
then
printf "vmx patched\n"
else
printf "vmx not patched\n"
fi
printf "Checking smcPresent status...\n"
vim-cmd hostsvc/hosthardware | grep smcPresent | cut -d ',' -f 1 | sed 's/^[ \t]*//'
exit