refactor: simplify confusing chain of commands

This commit is contained in:
José Oliveira 2022-03-04 17:14:57 +00:00
parent 6bb287ca38
commit 040d8d5bab
3 changed files with 8 additions and 8 deletions

View file

@ -27,27 +27,27 @@ function updateCore (coinRec, isCurrentlyRunning) {
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
common.es(`rm /tmp/dash.tar.gz`)
if (common.es(`ps -ef | grep "enableprivatesend=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
if (common.es(`grep "enableprivatesend=" /mnt/blockchains/dash/dash.conf || true`)) {
common.logger.info(`Switching from 'PrivateSend' to 'CoinJoin'...`)
common.es(`sed -i 's/enableprivatesend/enablecoinjoin/g' /mnt/blockchains/dash/dash.conf`)
} else if (common.es(`ps -ef | grep "enablecoinjoin=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
} else if (common.es(`grep "enablecoinjoin=" /mnt/blockchains/dash/dash.conf || true`)) {
common.logger.info(`enablecoinjoin already defined, skipping...`)
} else {
common.logger.info(`Enabling CoinJoin in config file...`)
common.es(`echo "enablecoinjoin=1" >> /mnt/blockchains/dash/dash.conf`)
}
if (common.es(`ps -ef | grep "privatesendautostart=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
if (common.es(`grep "privatesendautostart=" /mnt/blockchains/dash/dash.conf || true`)) {
common.logger.info(`Switching from 'PrivateSend' to 'CoinJoin'...`)
common.es(`sed -i 's/privatesendautostart/coinjoinautostart/g' /mnt/blockchains/dash/dash.conf`)
} else if (common.es(`ps -ef | grep "coinjoinautostart=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
} else if (common.es(`grep "coinjoinautostart=" /mnt/blockchains/dash/dash.conf || true`)) {
common.logger.info(`coinjoinautostart already defined, skipping...`)
} else {
common.logger.info(`Enabling CoinJoin AutoStart in config file...`)
common.es(`echo "coinjoinautostart=1" >> /mnt/blockchains/dash/dash.conf`)
}
if (common.es(`ps -ef | grep "litemode=" /mnt/blockchains/dash/dash.conf | { grep -v grep || true; }`)) {
if (common.es(`grep "litemode=" /mnt/blockchains/dash/dash.conf || true`)) {
common.logger.info(`Switching from 'LiteMode' to 'DisableGovernance'...`)
common.es(`sed -i 's/litemode/disablegovernance/g' /mnt/blockchains/dash/dash.conf`)
} else {