-
Notifications
You must be signed in to change notification settings - Fork 5
/
install_kext.sh
executable file
·43 lines (37 loc) · 982 Bytes
/
install_kext.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
#!/bin/bash
DIR=$(dirname ${BASH_SOURCE[0]})
source $DIR/_install_cmds.sh
function showOptions() {
echo "-d, Directory to install all kexts within."
echo "-s, Destination directory (default: $kexts_dest)."
echo "-e, Exceptions list (single string) when installing multiple kexts."
echo "-h, Show this help message."
echo "Usage: $(basename $0) [Options] [Kext to install]"
echo "Example: $(basename $0) -e 'VoodooHDA|AppleALC|Sensors' ~/Downloads/*.kext"
}
while getopts e:s:d:h option; do
case $option in
e)
exceptions=$OPTARG
;;
s)
kexts_dest=$OPTARG
;;
d)
directory=$OPTARG
;;
h)
showOptions
exit 0
;;
esac
done
shift $((OPTIND-1))
if [[ -d "$directory" ]]; then
installKextsInDirectory "$directory" "$kexts_dest" "$exceptions"
elif [[ -d "$1" ]]; then
installKext "$1"
else
showOptions
exit 1
fi