Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie authored Aug 29, 2022
1 parent 3eb1382 commit 8cb2c89
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions install_candle_controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -724,38 +724,41 @@ fi
if [ -d /home/pi/.webthings/data/zigbee2mqtt-adapter ];
then

cd /home/pi/.webthings/data/zigbee2mqtt-adapter
if [ ! -d /home/pi/.webthings/data/zigbee2mqtt-adapter/zigbee2mqtt ];
then
cd /home/pi/.webthings/data/zigbee2mqtt-adapter

echo
echo "pre-installing Zigbee2MQTT"
echo
curl -s "https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest" \
| grep "tarball_url" \
| cut -d : -f 2,3 \
| tr -d \" \
| sed 's/,*$//' \
| wget -qi - -O z2m.tgz
echo "unpacking z2m.tgz"
tar -xf z2m.tgz
rm z2m.tgz

for directory in Koenkk-zigbee2mqtt*; do
[[ -d $directory ]] || continue
echo "Directory: $directory"
rm -rf ./zigbee2mqtt
mv -- "$directory" ./zigbee2mqtt
done
echo
echo "pre-installing Zigbee2MQTT"
echo
curl -s "https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest" \
| grep "tarball_url" \
| cut -d : -f 2,3 \
| tr -d \" \
| sed 's/,*$//' \
| wget -qi - -O z2m.tgz
echo "unpacking z2m.tgz"
tar -xf z2m.tgz
rm z2m.tgz

for directory in Koenkk-zigbee2mqtt*; do
[[ -d $directory ]] || continue
echo "Directory: $directory"
rm -rf ./zigbee2mqtt
mv -- "$directory" ./zigbee2mqtt
done

if [ -d ./zigbee2mqtt ]; then
chown -R pi:pi ./zigbee2mqtt
cd ./zigbee2mqtt
npm ci --production
else
echo "Error, pre-install of z2m failed: no dir"
fi
#https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest

if [ -d ./zigbee2mqtt ]; then
chown -R pi:pi ./zigbee2mqtt
cd ./zigbee2mqtt
npm ci --production
else
echo "Error, pre-install of z2m failed: no dir"
cd /home/pi/
fi
#https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest

cd /home/pi/

else
echo "Candle: WARNING, /home/pi/.webthings/data/zigbee2mqtt does not exist? Cannot pre-install zigbee2mqtt"
Expand Down

0 comments on commit 8cb2c89

Please sign in to comment.