fix: access crypto code properly and add admin permissions for supervisor cmds

This commit is contained in:
José Oliveira 2021-08-30 23:13:59 +01:00
parent db90525196
commit 01275a8c9b
3 changed files with 5 additions and 6 deletions

View file

@ -18,7 +18,7 @@ function setup (dataDir) {
function updateCore (coinRec) {
common.logger.info('Updating Bitcoin Core. This may take a minute.')
common.es(`supervisorctl stop bitcoin`)
common.es(`sudo supervisorctl stop bitcoin`)
common.es(`curl -#o /tmp/bitcoin.tar.gz ${coinRec.url}`)
common.es(`tar -xzf /tmp/bitcoin.tar.gz -C /tmp/`)
@ -28,7 +28,7 @@ function updateCore (coinRec) {
common.es(`rm /tmp/bitcoin.tar.gz`)
common.logger.info('Starting wallet...')
common.es(`supervisorctl start bitcoin`)
common.es(`sudo supervisorctl start bitcoin`)
common.logger.info('Bitcoin Core is updated!')
}

View file

@ -3,7 +3,6 @@ const os = require('os')
const path = require('path')
const cp = require('child_process')
const fs = require('fs')
const btc = require('./bitcoin')
const _ = require('lodash/fp')
@ -94,7 +93,7 @@ function isInstalledSoftware (coinRec) {
}
function fetchAndInstall (coinRec) {
const requiresUpdate = isUpdateDependent(coinRec.code)
const requiresUpdate = isUpdateDependent(coinRec.cryptoCode)
if (isInstalledSoftware(coinRec)) return
const binaries = BINARIES[coinRec.cryptoCode]

View file

@ -94,9 +94,9 @@ function setupCrypto (crypto) {
}
function updateCrypto (crypto) {
if (!common.isUpdateDependent(crypto.code)) return
if (!common.isUpdateDependent(crypto.cryptoCode)) return
const cryptoPlugin = plugin(crypto)
cryptoPlugin.updateCore(common.getBinaries(crypto))
cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode))
}
function plugin (crypto) {