initial check-in
This commit is contained in:
17
linux-service/Mqtt2ThingBoardGateWay.service
Normal file
17
linux-service/Mqtt2ThingBoardGateWay.service
Normal 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/Mqtt2ThingBoardGateWay
|
||||
ExecStart=/opt/Mqtt2ThingBoardGateWay/Mqtt2ThingBoardGateWay.py
|
||||
ExecStop=/bin/sleep 1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
linux-service/easy_install.sh
Normal file
26
linux-service/easy_install.sh
Normal 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/Mqtt2ThingBoardGateWay" ]; then
|
||||
systemctl stop Mqtt2ThingBoardGateWay.service
|
||||
cp Mqtt2ThingBoardGateWay.py /opt/Mqtt2ThingBoardGateWay/
|
||||
cp example-key.pem /opt/Mqtt2ThingBoardGateWay/
|
||||
cp example-cert.pem /opt/Mqtt2ThingBoardGateWay/
|
||||
else
|
||||
mkdir /opt/Mqtt2ThingBoardGateWay
|
||||
cp Mqtt2ThingBoardGateWay.py /opt/Mqtt2ThingBoardGateWay/
|
||||
cp example-key.pem /opt/Mqtt2ThingBoardGateWay/
|
||||
cp example-cert.pem /opt/Mqtt2ThingBoardGateWay/
|
||||
fi
|
||||
|
||||
cp Mqtt2ThingBoardGateWay.service /lib/systemd/system/
|
||||
chmod 644 /lib/systemd/system/Mqtt2ThingBoardGateWay.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable Mqtt2ThingBoardGateWay.service
|
||||
systemctl start Mqtt2ThingBoardGateWay.service
|
||||
|
||||
echo -e "\033[32m Installation completed. Mqtt2ThingBoardGateWay is now up and running.\033[0m"
|
||||
18
linux-service/easy_uninstall.sh
Normal file
18
linux-service/easy_uninstall.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
cd /tmp
|
||||
|
||||
echo -e "\033[36m Mqtt2ThingBoardGateWay Service.\033[0m"
|
||||
systemctl stop Mqtt2ThingBoardGateWay.service
|
||||
|
||||
|
||||
### Uninstalling Mqtt2ThingBoardGateWay
|
||||
echo -e "\033[36m Uninstalling Mqtt2ThingBoardGateWay.\033[0m"
|
||||
|
||||
rm -rf /opt/Mqtt2ThingBoardGateWay/
|
||||
|
||||
systemctl disable Mqtt2ThingBoardGateWay.service
|
||||
rm /lib/systemd/system/Mqtt2ThingBoardGateWay.service
|
||||
systemctl daemon-reload
|
||||
|
||||
|
||||
echo -e "\033[32m Uninstall complete!\033[0m"
|
||||
Reference in New Issue
Block a user