-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
48 lines (35 loc) · 1.48 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
48
#!/usr/bin/env bash
echo "The next actions will be executed:"
echo " - copy temp2controler to /usr/bin/bash"
echo " - copy config file to /etc/temp2fan.conf"
echo " - copy the temp2fan.service and temp2fan.timer to /etc/systemd/system"
echo " - reload systemd"
echo " - start and enable systemd service"
# copy config to etc
sudo cp temp2fan.conf /etc
# copy service and timer to the corresponding folder
sudo cp temp2fan-controler.sh /usr/bin/
echo "Copy temp2fan.controler.sh to /usr/bin/.......done"
sudo cp temp2fan.service /etc/systemd/system/ && sudo cp temp2fan.timer /etc/systemd/system/
echo "Copy temp2fan.service and temp2fan.timer to /etc/systemd/system/.......done"
# reload systemctl to be able to start and enable
sudo systemctl daemon-reload
#start and enable service
sudo systemctl start temp2fan.service
sudo systemctl enable temp2fan.service
# start and enable timer
sudo systemctl start temp2fan.timer
sudo systemctl enable temp2fan.timer
echo "Start and enable servide and timer.......done"
sudo chmod o+w /sys/devices/platform/applesmc.768/fan*_output
sudo chmod o+w /sys/devices/platform/applesmc.768/fan*_manual
sudo chmod +x /usr/bin/temp2fan-controler.sh
echo "Permission to write and execute added to corresponding files.......done"
cd /sys/devices/platform/applesmc.768/
# This code will set fans to manual mode.
for fan in /sys/devices/platform/applesmc.768/fan*_manual
do
sudo echo 1 > $fan
done
echo "Manual mode fans on.......done"
echo "The installation is complete.."