forked from Pyrestone/jetson-fan-ctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·34 lines (28 loc) · 855 Bytes
/
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
#!/bin/bash
#Require sudo
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
echo "settling to /usr/local/bin/automagic-fan/..."
rm -r /usr/bin/automagic-fan/ 2>/dev/null
mkdir -p /usr/local/bin/automagic-fan
cp fanctl.py /usr/local/bin/automagic-fan/
echo "done"
echo "adding service to /lib/systemd/system/..."
cp automagic-fan.service /lib/systemd/system/
chmod 644 /lib/systemd/system/automagic-fan.service
echo "done"
echo "creating config at /etc/automagic-fan/"
mkdir /etc/automagic-fan/
cp config.json /etc/automagic-fan/
chmod 664 /etc/automagic-fan/config.json
echo "done"
echo "starting and enabling service..."
systemctl daemon-reload
systemctl start automagic-fan
systemctl enable automagic-fan
echo "done"
echo "automagic-fan installed sucessfully!"
echo ""
echo "To configure, edit /etc/automagic-fan/config.json (needs sudo)"