Merge pull request #1092 from josepfo/fix/update-wallet-nodes-not-running

fix: update only if node is stopped
This commit is contained in:
Rafael Taranto 2022-02-10 13:07:56 +00:00 committed by GitHub
commit 3dadb9ad10
6 changed files with 6 additions and 7 deletions

View file

@ -29,8 +29,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), _.includes(status, ['RUNNING', 'STARTING']))
}, cryptos)
}

View file

@ -18,7 +18,7 @@ function setup (dataDir) {
function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating Bitcoin Cash. This may take a minute...')
if (isCurrentlyRunning) common.es(`sudo supervisorctl stop bitcoincash`)
common.es(`sudo supervisorctl stop bitcoincash`)
common.es(`curl -#Lo /tmp/bitcoincash.tar.gz ${coinRec.url}`)
common.es(`tar -xzf /tmp/bitcoincash.tar.gz -C /tmp/`)

View file

@ -18,7 +18,7 @@ function setup (dataDir) {
function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating Dash Core. This may take a minute...')
if (isCurrentlyRunning) common.es(`sudo supervisorctl stop dash`)
common.es(`sudo supervisorctl stop dash`)
common.es(`curl -#Lo /tmp/dash.tar.gz ${coinRec.url}`)
common.es(`tar -xzf /tmp/dash.tar.gz -C /tmp/`)

View file

@ -6,7 +6,7 @@ module.exports = { setup, updateCore }
function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating the Geth Ethereum wallet. This may take a minute...')
if (isCurrentlyRunning) common.es(`sudo supervisorctl stop ethereum`)
common.es(`sudo supervisorctl stop ethereum`)
common.es(`curl -#o /tmp/ethereum.tar.gz ${coinRec.url}`)
common.es(`tar -xzf /tmp/ethereum.tar.gz -C /tmp/`)

View file

@ -18,7 +18,7 @@ function setup (dataDir) {
function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating Litecoin Core. This may take a minute...')
if (isCurrentlyRunning) common.es(`sudo supervisorctl stop litecoin`)
common.es(`sudo supervisorctl stop litecoin`)
common.es(`curl -#o /tmp/litecoin.tar.gz ${coinRec.url}`)
common.es(`tar -xzf /tmp/litecoin.tar.gz -C /tmp/`)

View file

@ -11,7 +11,7 @@ const logger = common.logger
function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating your Zcash wallet. This may take a minute...')
if (isCurrentlyRunning) common.es(`sudo supervisorctl stop zcash`)
common.es(`sudo supervisorctl stop zcash`)
common.es(`curl -#Lo /tmp/zcash.tar.gz ${coinRec.url}`)
common.es(`tar -xzf /tmp/zcash.tar.gz -C /tmp/`)