-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathoverclock-pi.sh
More file actions
executable file
·92 lines (75 loc) · 2.15 KB
/
overclock-pi.sh
File metadata and controls
executable file
·92 lines (75 loc) · 2.15 KB
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
#!/usr/bin/env bash
# Asks you which Raspberry Pi you have,
# and applies probably-safe overclock settings.
#
# Warns you repeatedly that you WILL void your warranty and
# MAY break your Pi.
function confirm {
while true; do
read -r -p "$1 [Y/n] " INPUT
case "${INPUT}" in
[yY])
return 0
;;
[nN])
return 1
;;
*)
echo "Not sure what you meant. Please answer with 'Y' or 'n'."
;;
esac
done
}
cat << EOF
###########################################################
# #
# OVERCLOCK WARNING #
# #
# 1. Overclocking can break your Pi. #
# 2. This overclock WILL void your warranty. #
# 3. Selecting the WRONG overclock can break your pi. #
# #
# Are you sure you want to continue? #
# #
###########################################################
EOF
if ! confirm "Continue with overclocking?"; then
exit 0
fi
USER_WHICHPI=$1
if [ -z $USER_WHICHPI ] ; then
while true; do
echo -e "Which Raspbery Pi is this running on?\n\t0: 3B\n\t1: 3B+\n\t2: 4B"
read -p ": " USER_WHICHPI
case "${USER_WHICHPI}" in
0)
WHICHPI="3b"
break
;;
1)
WHICHPI="3b+"
break
;;
2)
WHICHPI="4b"
break
;;
esac
done
else
WHICHPI=${USER_WHICHPI}
fi
cat << EOF
###########################################################
# #
# OVERCLOCK WARNING #
# #
# 1. This overclock WILL void your warranty. #
# 2. Selecting the WRONG overclock can break your pi. #
# #
###########################################################
EOF
if ! confirm "Is this really a Raspberry Pi ${WHICHPI}?"; then
exit 0
fi
sudo ./merge-config.sh ./performance-tune/raspi-${WHICHPI}-oc.config /boot/config.txt