-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
47 lines (40 loc) · 1.2 KB
/
install.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
#!/usr/bin/bash
if [ "${EUID}" -ne 0 ]; then
echo "Error: you must to run this script as root";
exit 1;
fi
if ! cpupower frequency-info >/dev/null 2>&1; then
echo "Error: 'cpupower' isn't found";
echo "If you haven't it, you must to install 'linux-tools-common' and 'linux-tools-$(uname -r)'";
exit 1;
fi
if ! cp cpumode.sh /usr/bin/cpumode >/dev/null 2>&1; then
echo "Error: couldn't copy main file into /usr/bin";
exit 1;
else
chmod 755 /usr/bin/cpumode;
chmod +x /usr/bin/cpumode;
fi
if ! cp cpubalanced.sh /usr/bin/cpubalanced >/dev/null 2>&1; then
echo "Error: couldn't copy main file into /usr/bin";
exit 1;
else
chmod 755 /usr/bin/cpubalanced;
chmod +x /usr/bin/cpubalanced;
fi
if ! cp cpupowersave.sh /usr/bin/cpupowersave >/dev/null 2>&1; then
echo "Error: couldn't copy main file into /usr/bin";
exit 1;
else
chmod 755 /usr/bin/cpupowersave;
chmod +x /usr/bin/cpupowersave;
fi
if ! cp cpuperformance.sh /usr/bin/cpuperformance >/dev/null 2>&1; then
echo "Error: couldn't copy main file into /usr/bin";
exit 1;
else
chmod 755 /usr/bin/cpuperformance;
chmod +x /usr/bin/cpuperformance;
fi
echo "Installation was successful"
exit 0