forked from Koenkk/zigbee2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding update script Fix Koenkk#389 * Update update.sh :) * Make executable & update update.sh
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,5 @@ data/database.db | |
data/config.json | ||
data/log*.txt | ||
data/state.json | ||
data/log | ||
data/log | ||
data-backup/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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!" |