fix: trim cmd output and binaries paths

This commit is contained in:
José Oliveira 2021-09-08 17:07:15 +01:00
parent b53090db05
commit 9152c48e14
4 changed files with 7 additions and 5 deletions

View file

@ -24,9 +24,11 @@ function plugin (crypto) {
function run () {
_.forEach((crypto) => {
const cryptoPlugin = plugin(crypto)
if (!_.includes(crypto.cryptoCode, _.keys(PLUGINS))) return
const cryptoPlugin = plugin(crypto)
const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`).trim()
const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`)
if (status === 'RUNNING') cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), true)
if (status === 'STOPPED') cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), false)
}, cryptos)

View file

@ -23,7 +23,7 @@ function updateCore (coinRec, isCurrentlyRunning) {
common.es(`tar -xzf /tmp/dash.tar.gz -C /tmp/`)
common.logger.info('Updating wallet...')
common.es(`cp /tmp/${coinRec.dir}/bin/* /usr/local/bin/`)
common.es(`cp /tmp/${coinRec.dir}/* /usr/local/bin/`)
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
common.es(`rm /tmp/dash.tar.gz`)

View file

@ -23,7 +23,7 @@ function updateCore (coinRec, isCurrentlyRunning) {
common.es(`tar -xzf /tmp/litecoin.tar.gz -C /tmp/`)
common.logger.info('Updating wallet...')
common.es(`cp /tmp/${coinRec.dir}/bin/* /usr/local/bin/`)
common.es(`cp /tmp/${coinRec.dir}/* /usr/local/bin/`)
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
common.es(`rm /tmp/litecoin.tar.gz`)

View file

@ -99,7 +99,7 @@
"lamassu-ofac-update": "./bin/lamassu-ofac-update",
"lamassu-send-coins": "./bin/lamassu-send-coins",
"lamassu-update-to-mnemonic": "./bin/lamassu-update-to-mnemonic",
"lamassu-update-nodes": "./bin/lamassu-update-nodes",
"lamassu-update-wallet-nodes": "./bin/lamassu-update-wallet-nodes",
"lamassu-configure-frontcamera": "./bin/lamassu-configure-frontcamera",
"lamassu-ofac-update-sources": "./bin/lamassu-ofac-update-sources",
"lamassu-devices": "./bin/lamassu-devices",