-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·49 lines (44 loc) · 1.65 KB
/
install.sh
File metadata and controls
executable file
·49 lines (44 loc) · 1.65 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
#!/bin/bash
usage()
{
echo "Usage: $0 [INSTALLER OPTIONS] [APP OPTIONS]"
echo ""
echo "This script will install this project. You can tell this script with which arguments to call the program itself."
echo ""
echo "INSTALLER OPTIONS:"
echo " -u, --user-config - use device configuration file from user"
echo " -h, --help - show this"
echo ""
echo "APP OPTIONS - specify with which options the program (deepcool-digital-info.py) should be launched"
}
USER_CONFIG=0
while [[ $# -gt 0 ]]; do
case $1 in
-u|--user-config)
USER_CONFIG=1
shift
;;
-h|--help)
usage
exit 0
;;
*)
ARGS="$ARGS $1"
shift
;;
esac
done
sudo systemctl stop deepcool-temp.service
sudo cp -f deepcool-temp.service /lib/systemd/system/
sudo sed -i "s|ExecStart= /usr/bin/python3 /usr/local/bin/deepcool-digital-info.py -j /usr/local/share/applications/deepcool-devices.json5|ExecStart= /usr/bin/python3 /usr/local/bin/deepcool-digital-info.py -j /usr/local/share/applications/deepcool-devices.json5${ARGS}|g" /lib/systemd/system/deepcool-temp.service
sudo cp -f deepcool-temp-restart.service /lib/systemd/system/
sudo cp -f deepcool-digital-info.py /usr/local/bin/deepcool-digital-info.py
sudo mkdir -p /usr/local/share/applications
if [ "${USER_CONFIG}" -eq 1 ] && [ -f user-devices.json5 ]; then
sudo cp -f user-devices.json5 /usr/local/share/applications/deepcool-devices.json5
else
sudo cp -f devices.json5 /usr/local/share/applications/deepcool-devices.json5
fi
sudo systemctl enable deepcool-temp.service
sudo systemctl enable deepcool-temp-restart.service
sudo systemctl start deepcool-temp.service