fix: handle grep error output
This commit is contained in:
parent
c8f5e471be
commit
5d24b427ca
3 changed files with 26 additions and 5 deletions
|
|
@ -27,6 +27,20 @@ function updateCore (coinRec, isCurrentlyRunning) {
|
||||||
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
||||||
common.es(`rm /tmp/bitcoin.tar.gz`)
|
common.es(`rm /tmp/bitcoin.tar.gz`)
|
||||||
|
|
||||||
|
if (common.es(`ps -ef | grep -q "changetype=" /mnt/blockchains/bitcoin/bitcoin.conf | { grep -v grep || true; }`)) {
|
||||||
|
common.logger.info(`changetype already defined, skipping...`)
|
||||||
|
} else {
|
||||||
|
common.logger.info(`Enabling bech32 change addresses in config file..`)
|
||||||
|
common.es(`echo -e "\nchangetype=bech32" >> /mnt/blockchains/bitcoin/bitcoin.conf`)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.es(`ps -ef | grep -q "listenonion=" /mnt/blockchains/bitcoin/bitcoin.conf | { grep -v grep || true; }`)) {
|
||||||
|
common.logger.info(`listenonion already defined, skipping...`)
|
||||||
|
} else {
|
||||||
|
common.logger.info(`Setting 'listenonion=0' in config file...`)
|
||||||
|
common.es(`echo -e "\nlistenonion=0" >> /mnt/blockchains/bitcoin/bitcoin.conf`)
|
||||||
|
}
|
||||||
|
|
||||||
if (isCurrentlyRunning) {
|
if (isCurrentlyRunning) {
|
||||||
common.logger.info('Starting wallet...')
|
common.logger.info('Starting wallet...')
|
||||||
common.es(`sudo supervisorctl start bitcoin`)
|
common.es(`sudo supervisorctl start bitcoin`)
|
||||||
|
|
|
||||||
|
|
@ -27,27 +27,27 @@ function updateCore (coinRec, isCurrentlyRunning) {
|
||||||
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
||||||
common.es(`rm /tmp/dash.tar.gz`)
|
common.es(`rm /tmp/dash.tar.gz`)
|
||||||
|
|
||||||
if (common.es(`grep -x "enableprivatesend=." /mnt/blockchains/dash/dash.conf`)) {
|
if (common.es(`ps -ef | grep -q "enableprivatesend=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
|
||||||
common.logger.info(`Switching from 'PrivateSend' to 'CoinJoin'...`)
|
common.logger.info(`Switching from 'PrivateSend' to 'CoinJoin'...`)
|
||||||
common.es(`sed -i 's/enableprivatesend/enablecoinjoin/g' /mnt/blockchains/dash/dash.conf`)
|
common.es(`sed -i 's/enableprivatesend/enablecoinjoin/g' /mnt/blockchains/dash/dash.conf`)
|
||||||
} else if (common.es(`grep -x "enablecoinjoin=." /mnt/blockchains/dash/dash.conf`)) {
|
} else if (common.es(`ps -ef | grep -q "enablecoinjoin=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
|
||||||
common.logger.info(`enablecoinjoin already defined, skipping...`)
|
common.logger.info(`enablecoinjoin already defined, skipping...`)
|
||||||
} else {
|
} else {
|
||||||
common.logger.info(`Enabling CoinJoin in config file...`)
|
common.logger.info(`Enabling CoinJoin in config file...`)
|
||||||
common.es(`echo -e "enablecoinjoin=1" >> /mnt/blockchains/dash/dash.conf`)
|
common.es(`echo -e "enablecoinjoin=1" >> /mnt/blockchains/dash/dash.conf`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common.es(`grep -x "privatesendautostart=." /mnt/blockchains/dash/dash.conf`)) {
|
if (common.es(`ps -ef | grep -q "privatesendautostart=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
|
||||||
common.logger.info(`Switching from 'PrivateSend' to 'CoinJoin'...`)
|
common.logger.info(`Switching from 'PrivateSend' to 'CoinJoin'...`)
|
||||||
common.es(`sed -i 's/privatesendautostart/coinjoinautostart/g' /mnt/blockchains/dash/dash.conf`)
|
common.es(`sed -i 's/privatesendautostart/coinjoinautostart/g' /mnt/blockchains/dash/dash.conf`)
|
||||||
} else if (common.es(`grep -x "coinjoinautostart=." /mnt/blockchains/dash/dash.conf`)) {
|
} else if (common.es(`ps -ef | grep -q "coinjoinautostart=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
|
||||||
common.logger.info(`coinjoinautostart already defined, skipping...`)
|
common.logger.info(`coinjoinautostart already defined, skipping...`)
|
||||||
} else {
|
} else {
|
||||||
common.logger.info(`Enabling CoinJoin AutoStart in config file...`)
|
common.logger.info(`Enabling CoinJoin AutoStart in config file...`)
|
||||||
common.es(`echo -e "coinjoinautostart=1" >> /mnt/blockchains/dash/dash.conf`)
|
common.es(`echo -e "coinjoinautostart=1" >> /mnt/blockchains/dash/dash.conf`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common.es(`grep -x "litemode=." /mnt/blockchains/dash/dash.conf`)) {
|
if (common.es(`ps -ef | grep -q "litemode=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
|
||||||
common.logger.info(`Switching from 'LiteMode' to 'DisableGovernance'...`)
|
common.logger.info(`Switching from 'LiteMode' to 'DisableGovernance'...`)
|
||||||
common.es(`sed -i 's/litemode/disablegovernance/g' /mnt/blockchains/dash/dash.conf`)
|
common.es(`sed -i 's/litemode/disablegovernance/g' /mnt/blockchains/dash/dash.conf`)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,13 @@ function updateCore (coinRec, isCurrentlyRunning) {
|
||||||
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
||||||
common.es(`rm /tmp/litecoin.tar.gz`)
|
common.es(`rm /tmp/litecoin.tar.gz`)
|
||||||
|
|
||||||
|
if (common.es(`ps -ef | grep -q "changetype=" /mnt/blockchains/litecoin/litecoin.conf | { grep -v grep || true; }`)) {
|
||||||
|
common.logger.info(`changetype already defined, skipping...`)
|
||||||
|
} else {
|
||||||
|
common.logger.info(`Enabling bech32 change addresses in config file..`)
|
||||||
|
common.es(`echo -e "\nchangetype=bech32" >> /mnt/blockchains/litecoin/litecoin.conf`)
|
||||||
|
}
|
||||||
|
|
||||||
if (isCurrentlyRunning) {
|
if (isCurrentlyRunning) {
|
||||||
common.logger.info('Starting wallet...')
|
common.logger.info('Starting wallet...')
|
||||||
common.es(`sudo supervisorctl start litecoin`)
|
common.es(`sudo supervisorctl start litecoin`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue