-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·37 lines (32 loc) · 909 Bytes
/
install.sh
File metadata and controls
executable file
·37 lines (32 loc) · 909 Bytes
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
#!/bin/bash
if [ $EUID != 0 ]; then
echo "This script must be run as root."
exit $exit_code
exit 1
fi
# install system packages
apt install -y \
python3-pip \
python3-augeas \
python3-apt \
python3-venv \
aptitude \
lm-sensors
# create virtual environment
python3 -m venv --system-site-packages /opt/tooloop/control-center/venv
# install site packages
/opt/tooloop/control-center/venv/bin/pip install --upgrade pip
/opt/tooloop/control-center/venv/bin/pip install Flask pexpect python-crontab zeroconf sensors.py
# publish services over Avahi/Bonjour
cat > /etc/avahi/services/tooloop-control-center.service <<EOF
<?xml version="1.0" standalone='no'?>
<!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
</service>
</service-group>
EOF