-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvma2pwn.sh
executable file
·53 lines (41 loc) · 1020 Bytes
/
vma2pwn.sh
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
52
53
#!/bin/zsh
#
# vma2pwn - vma2pwn.sh
# v0.1.0
#
# Fail-fast
set -e
function printUsage {
echo 'Usage:'
echo '\t./vma2pwn.sh help'
echo ''
echo '\t./vma2pwn.sh prepare <macOS version>'
echo '\t\te.g., ./vma2pwn.sh prepare 12.0.1'
echo ''
echo '\t./vma2pwn.sh restore <directory>'
echo '\t\te.g., ./vma2pwn.sh restore ./UniversalMac_12.0.1_21A559_Restore'
}
# Check if input argument length is not 3
if ! [[ $# -ne 3 ]]; then
printUsage
if [ $1 = 'help' ]; then
exit 0
fi
exit -1
fi
# Check if first argument is 'prepare' or 'restore'
if [ "$1" = 'prepare' ]; then
./check-rosetta2.sh
./get-dependencies.sh
./prepare.sh "$2"
elif [ "$1" = 'restore' ]; then
# Check for idevicerestore command
if ! [ -x "$(command -v idevicerestore)" ]; then
echo 'idevicerestore is required but was not found, please install it before continuing!'
exit -1
fi
idevicerestore -e -y "$2"
else
printUsage
exit -1
fi