-
Notifications
You must be signed in to change notification settings - Fork 57
/
autoinstaller.command
executable file
·156 lines (139 loc) · 3.49 KB
/
autoinstaller.command
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
function logo()
{
#printf '\e[8;40;110t'
echo "
//// /////
/////// ///////
//////// ////////
/// ///////// //////// ///
////// //////// //////// /////
//////// /////// /////// ///////
///////// ////// ////// ////////
///////// ///// ///// ////////
//// ///////// //// //// //////// ////
/////// /////// /// /// /////// //////
///////// //// // // //// ////////
//////// /// // /////////
........... ..........
////////// ///////////
////// //////
"
}
function checkEFI()
{
sudo diskutil mount /dev/disk0s1
DIR=/Volumes/EFI/EFI/CLOVER
if [ ! -d "$DIR" ]; then
echo "CLOVER files not found"
sleep 1
diskutil list
echo "Please type in your EFI location (ex: disk0s2) and then press enter"
read location
sudo diskutil mount /dev/$location
if [ ! -d "$DIR" ]; then
echo "Sorry, still no Clover files found"
echo "Please make sure that your EFI partition is named EFI, then run the script again"
sleep 3
echo "Goodbye"
sleep 1
exit
else
echo "CLOVER files found"
fi
else
echo "CLOVER files found"
fi
}
function checkFiles()
{
DIRECTORY=`dirname $0`
cd $DIRECTORY
DIR=./CLOVER
if [ -d "$DIR" ]; then
copyFiles
else
echo "Github CLOVER files not found in current directory"
cd ~/Downloads
DIR=./MatebookXPro-hackintosh-master/CLOVER
if [ -d "$DIR" ]; then
echo "Github files found in /Downloads"
cd ~/Downloads/MatebookXPro-hackintosh-master
copyFiles
else
echo "Github files not found in /Downloads"
echo "Please download the Github files to the current directory or /Downloads"
fi
fi
}
function copyFiles()
{
cp -R ./CLOVER/ /Volumes/EFI/EFI/CLOVER/
echo "Done copying files"
return
}
function disableHibernation()
{
sudo pmset -a hibernatemode 0
sudo rm /var/vm/sleepimage
sudo mkdir /var/vm/sleepimage
sudo pmset -a standby 0
sudo pmset -a autopoweroff 0
}
function setupWifi()
{
BASEDIR=$(dirname $0)
sudo mv ${BASEDIR}/Intel-WiFi/
./HeliPort.app ~Applications/HeliPort.app
exit
;;
n)
echo "To setup WiFi, please run the HeliPort app and set it to launch at startup"
sleep 3
exit
;;
*)
echo "Please press y or n lol"
echo "Exiting"
sleep 1
exit
;;
esac
}
function restart()
{
echo "----------------------"
echo "**** Restart Now? ****"
echo "----------------------"
read -p "Type y/n : " lfm_selection
case "${lfm_selection}" in
y)
sudo reboot
exit
;;
n)
echo "Please help a broke student out please :)"
echo "Thank you! Have a great day!"
sleep 3
open .//Help\ a\ Broke\ Student\ out/paypal.png
open .//Help\ a\ Broke\ Student\ out/venmo.jpg
exit
;;
*)
echo "Please press y or n lol"
echo "Exiting"
sleep 1
exit
;;
esac
}
function main()
{
logo
disableHibernation
checkEFI
checkFiles
setupWifi
restart
}
main