zigbee2mqtt/update.sh

24 lines
414 B
Bash
Raw Normal View History

#!/bin/bash -e
2020-08-01 01:36:20 -07:00
echo "Stopping Zigbee2MQTT..."
sudo systemctl stop zigbee2mqtt
echo "Creating backup of configuration..."
cp -R data data-backup
echo "Updating..."
git checkout HEAD -- npm-shrinkwrap.json
git pull
echo "Installing dependencies..."
npm ci
echo "Restore configuration..."
cp -R data-backup/* data
rm -rf data-backup
2020-08-01 01:36:20 -07:00
echo "Starting Zigbee2MQTT..."
sudo systemctl start zigbee2mqtt
echo "Done!"