fix: bitcoind install
This commit is contained in:
parent
f83ea0a06c
commit
4532482015
2 changed files with 8 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ function setup (dataDir) {
|
||||||
|
|
||||||
function updateCore (coinRec, isCurrentlyRunning) {
|
function updateCore (coinRec, isCurrentlyRunning) {
|
||||||
common.logger.info('Updating Bitcoin Core. This may take a minute...')
|
common.logger.info('Updating Bitcoin Core. This may take a minute...')
|
||||||
if (isCurrentlyRunning) common.es(`sudo supervisorctl stop bitcoin`)
|
common.es(`sudo supervisorctl stop bitcoin`)
|
||||||
common.es(`curl -#o /tmp/bitcoin.tar.gz ${coinRec.url}`)
|
common.es(`curl -#o /tmp/bitcoin.tar.gz ${coinRec.url}`)
|
||||||
common.es(`tar -xzf /tmp/bitcoin.tar.gz -C /tmp/`)
|
common.es(`tar -xzf /tmp/bitcoin.tar.gz -C /tmp/`)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,10 @@ function processCryptos (codes) {
|
||||||
) | crontab -`
|
) | crontab -`
|
||||||
common.es(rsyncCmd)
|
common.es(rsyncCmd)
|
||||||
|
|
||||||
_.forEach(updateCrypto, selectedCryptos)
|
_.forEach(c => {
|
||||||
|
updateCrypto(c)
|
||||||
|
common.es(`sudo supervisorctl start ${c.code}`)
|
||||||
|
}, selectedCryptos)
|
||||||
|
|
||||||
logger.info('Installation complete.')
|
logger.info('Installation complete.')
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +101,9 @@ function setupCrypto (crypto) {
|
||||||
function updateCrypto (crypto) {
|
function updateCrypto (crypto) {
|
||||||
if (!common.isUpdateDependent(crypto.cryptoCode)) return
|
if (!common.isUpdateDependent(crypto.cryptoCode)) return
|
||||||
const cryptoPlugin = plugin(crypto)
|
const cryptoPlugin = plugin(crypto)
|
||||||
cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode))
|
const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`).trim()
|
||||||
|
const isCurrentlyRunning = status === 'RUNNING'
|
||||||
|
cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), isCurrentlyRunning)
|
||||||
}
|
}
|
||||||
|
|
||||||
function plugin (crypto) {
|
function plugin (crypto) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue