This commit is contained in:
Robert Köpferl 2020-06-21 00:58:04 +02:00
parent cdc56e2169
commit bdfa2dd20a
3 changed files with 11 additions and 5 deletions

View File

@ -3,7 +3,7 @@ Description=Temperatur und Luftfeuchte-Sammler-service.
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/bin/temp+feucht-DHT22.py
ExecStart=/usr/bin/python3 /opt/bienen/temp+feucht-DHT22.py
[Install]
WantedBy=multi-user.target

View File

@ -3,7 +3,7 @@ Description=Gewicht-Sammler-service.
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/bin/weight-datageneration.py
ExecStart=/usr/bin/python3 /opt/bienen/weight-datageneration.py
[Install]
WantedBy=multi-user.target

View File

@ -11,10 +11,11 @@ if [ "$EUID" -ne 0 ]
exit
fi
# Skripte nach usr/bin kopieren
# Skripte nach /opt/bienen kopieren
mkdir -p /opt/bienen
# dabei über SED drüberjagen, variablen ersetzen
#cp src/temp+feucht-DHT22.py /usr/bin/temp+feucht-DHT22.py
#cp src/weight-datageneration.py /usr/bin/weight-datageneration.py
#cp src/temp+feucht-DHT22.py /opt/bienen/temp+feucht-DHT22.py
#cp src/weight-datageneration.py /opt/bienen/weight-datageneration.py
for f in temp+feucht-DHT22.py weight-datageneration.py
do
# / ersetzen durch \/
@ -24,10 +25,15 @@ do
cat src/$f | sed 's/%GRAFANA_URL%/'$Var'/' > /usr/bin/$f
done
# Repo von ul-gh/PiPyADC in /opt/bienen clonen
git submodule update PiPyADC
cp -av PiPyADC /opt/bienen/PiPyADC
# systemd unit files kopieren und chmod
cp src/systemd/temp-feuchte-sammler.service /etc/systemd/system/temp-feuchte-sammler.service
cp src/systemd/weight-sammler.service /etc/systemd/system/weight-sammler.service
chmod 644 /etc/systemd/system/weight-sammler.service
chmod 644 /etc/systemd/system/temp-feuchte-sammler.service
# services enablen - starten so automatisch
systemctl enable temp-feuchte-sammler