initial commit from old development

This commit is contained in:
2021-06-07 17:03:43 +02:00
commit c1e8b31910
8 changed files with 354 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
[Unit]
Description=BoschHomeAutomation 2 MQTT Gateway
After=multi-user.target
[Service]
Type=idle
Restart=always
RestartSec=30
StartLimitInterval=200
StartLimitBurst=5
WorkingDirectory=/opt/bsh-gateway
ExecStart=/opt/bsh-gateway/BSHGateWay.py
ExecStop=/bin/sleep 1
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
mac=`cat /sys/class/net/$(ip route get 8.8.8.8 | sed -n 's/.* dev \([^ ]*\).*/\1/p')/address`
arch=`uname -m`
### installing bsh gateway
echo -e "\033[36m Installing BSH Gateway.\033[0m"
if [ -d "/opt/bsh-gateway" ]; then
systemctl stop bsh-gateway.service
cp BSHGateWay.py /opt/bsh-gateway/
cp example-key.pem /opt/bsh-gateway/
cp example-cert.pem /opt/bsh-gateway/
else
mkdir /opt/bsh-gateway
cp BSHGateWay.py /opt/bsh-gateway/
cp example-key.pem /opt/bsh-gateway/
cp example-cert.pem /opt/bsh-gateway/
fi
cp bsh-gateway.service /lib/systemd/system/
chmod 644 /lib/systemd/system/bsh-gateway.service
systemctl daemon-reload
systemctl enable bsh-gateway.service
systemctl start bsh-gateway.service
echo -e "\033[32m Installation completed. BSH 2 MQTT Gateway is now up and running.\033[0m"

View File

@@ -0,0 +1,18 @@
#!/bin/bash
cd /tmp
echo -e "\033[36m BSH GateWay Service.\033[0m"
systemctl stop bsh-gateway.service
### Uninstalling BSH GateWay
echo -e "\033[36m Uninstalling BSH GateWay.\033[0m"
rm -rf /opt/bsh-gateway/
systemctl disable bsh-gateway.service
rm /lib/systemd/system/bsh-gateway.service
systemctl daemon-reload
echo -e "\033[32m Uninstall complete!\033[0m"