26 lines
881 B
Bash
26 lines
881 B
Bash
#!/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" |