Skip to content

Instantly share code, notes, and snippets.

@Landrash
Created January 24, 2019 22:46
Show Gist options
  • Save Landrash/b761bf5f51d566d799d45dc3fe7352bc to your computer and use it in GitHub Desktop.
Save Landrash/b761bf5f51d566d799d45dc3fe7352bc to your computer and use it in GitHub Desktop.
zigbee2mqtt update script
#!/bin/bash -e
echo "Stopping zigbee2mqttdev..."
sudo systemctl stop zigbee2mqttdev
echo "Creating backup of configuration..."
cp -R data data-backup
echo "Updating..."
git pull
echo "Installing dependencies..."
rm -rf node_modules
npm install
echo "Restore configuration..."
cp -R data-backup/* data
rm -rf data-backup
echo "Starting zigbee2mqttdev..."
sudo systemctl start zigbee2mqttdev
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment