forked from edupr91/turbo-boost-disable
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfunctions.sh
executable file
·42 lines (37 loc) · 1.02 KB
/
functions.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
#!/usr/bin/env sh
# Contains function definitions for Turbo Boost Manager
RED='\033[91m'
GREEN='\033[92m'
NC='\033[0m'
CHECK_STATUS()
{
result=`kmutil showloaded -V release | grep -c com.rugarciap.DisableTurboBoost`
}
PRINT_STATUS()
{
echo
echo "Checking status of Turbo Boost..."
CHECK_STATUS
if [ $result -eq 0 ]; then
echo "TurboBoost: [${RED}enabled${NC}]"
else
echo "TurboBoost: [${GREEN}disabled${NC}]"
fi
echo
}
LOAD()
{
# Disables Turbo Boost
# loads the pre-signed kext from Turbo Boost Switcher
echo "[${GREEN}!${NC}]Disabling TurboBoost now...${NC}"
sudo /usr/bin/kmutil load --bundle-path '/Applications/tbswitcher_resources/DisableTurboBoost.64bits.kext'
PRINT_STATUS
}
UNLOAD()
{
# Enables Turbo Boost
# unloads the pre-signed kext from Turbo Boost Switcher
echo "[${RED}!${NC}]Unloading kext now...${NC}"
sudo /usr/bin/kmutil unload --bundle-path '/Applications/tbswitcher_resources/DisableTurboBoost.64bits.kext'
PRINT_STATUS
}