-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
39 lines (32 loc) · 1.09 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
#Installing dependency
git clone https://github.com/orangepi-xunlong/wiringOP.git
cd wiringOP
chmod +x ./build
sudo ./build clean
sudo ./build
cd ..
rm -R wiringOP
#Move everything to my_scrypts folder
mkdir -p $HOME/my_scripts/
mkdir -p $HOME/my_scripts/cooler_controller/
cp cooler_controller.sh $HOME/my_scripts/cooler_controller/
#Make script executable
sudo chmod +x $HOME/my_scripts/cooler_controller/cooler_controller.sh
#Add home path to service
echo "ExecStart="$HOME"/my_scripts/cooler_controller/cooler_controller.sh" >> cooler_controller.service
echo "
[Install]
WantedBy=multi-user.target" >> cooler_controller.service
#Add service
sudo cp cooler_controller.service /etc/systemd/system/
sudo systemctl enable cooler_controller.service
#Delete files
cd ..
rm -R opizero-fan-ctrl/
#Enable service
sudo systemctl enable cooler_controller.service
echo "==============================[ DONE ]=============================="
echo "To check service status use"
echo " sudo systemctl status cooler_controller.service"
echo "Script has been installed in "
echo " cd $HOME/my_scripts/cooler_controller"