fix of a race condition (#1789)

This commit is contained in:
Stephan Oeste 2020-11-23 23:07:56 +01:00 committed by rootzoll
parent 1010dad479
commit c6f434acaf

View File

@ -322,7 +322,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u sphinxrelay cp /home/sphinxrelay/sphinx-relay/config/config.json /home/sphinxrelay/sphinx-relay/config/config.json.bak
sudo cat /home/sphinxrelay/sphinx-relay/config/config.json | \
jq ".production.storage = \"/mnt/hdd/app-data/sphinxrelay/sphinx.db\"" | \
sudo -u sphinxrelay tee /home/sphinxrelay/sphinx-relay/config/config.json
sudo -u sphinxrelay tee /home/admin/config.json.tmp
sudo mv /home/admin/config.json.tmp /home/sphinxrelay/sphinx-relay/config/config.json
sudo chown sphinxrelay:sphinxrelay /home/sphinxrelay/sphinx-relay/config/config.json
# general app config
sudo -u sphinxrelay cp /home/sphinxrelay/sphinx-relay/config/app.json /home/sphinxrelay/sphinx-relay/config/app.json.bak
@ -473,4 +475,4 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
fi
echo "FAIL - Unknown Parameter $1"
exit 1
exit 1