mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-15 18:08:32 -07:00
Adding update script (#525)
* Adding update script Fix #389 * Update update.sh :) * Make executable & update update.sh
This commit is contained in:
parent
97cc56b691
commit
e54de4bea7
3
.gitignore
vendored
3
.gitignore
vendored
@ -62,4 +62,5 @@ data/database.db
|
||||
data/config.json
|
||||
data/log*.txt
|
||||
data/state.json
|
||||
data/log
|
||||
data/log
|
||||
data-backup/
|
24
update.sh
Executable file
24
update.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
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..."
|
||||
rm -rf node_modules
|
||||
npm install
|
||||
|
||||
echo "Restore configuration..."
|
||||
cp -R data-backup/* data
|
||||
rm -rf data-backup
|
||||
|
||||
echo "Starting zigbee2mqtt..."
|
||||
sudo systemctl start zigbee2mqtt
|
||||
|
||||
echo "Done!"
|
Loading…
Reference in New Issue
Block a user