fix: update only if node is stopped

This commit is contained in:
José Oliveira 2022-02-04 01:09:00 +00:00
parent 2da14d64b3
commit 604e300dd0
6 changed files with 6 additions and 7 deletions

View file

@ -28,8 +28,7 @@ function run () {
const cryptoPlugin = plugin(crypto)
const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`).trim()
if (status === 'RUNNING') cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), true)
if (status === 'STOPPED') cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), false)
cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), status === 'RUNNING')
}, cryptos)
}