Fix ckpool doesn’t need restart if not enabled

This commit is contained in:
Michele Marcucci 2024-04-12 14:07:13 +02:00
parent c5ff3622ea
commit c01fbee47a
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ const runGenerateBitcoinPassword = async (settings) => {
if (settings && settings.nodeRpcPassword) if (settings && settings.nodeRpcPassword)
return console.log('Bitcoin password found'); return console.log('Bitcoin password found');
else await utils.auth.changeNodeRpcPassword(); else await utils.auth.changeNodeRpcPassword(settings);
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }

View File

@ -38,7 +38,7 @@ module.exports.auth = {
exec(`echo 'futurebit:${password}' | sudo chpasswd`); exec(`echo 'futurebit:${password}' | sudo chpasswd`);
}, },
async changeNodeRpcPassword() { async changeNodeRpcPassword(settings) {
try { try {
console.log('Generating and saving bitcoin password'); console.log('Generating and saving bitcoin password');
@ -63,7 +63,7 @@ module.exports.auth = {
); );
exec('sudo systemctl restart node'); exec('sudo systemctl restart node');
exec('sudo systemctl restart ckpool'); if (settings?.nodeEnableSoloMining) exec('sudo systemctl restart ckpool');
} catch (err) { } catch (err) {
console.log('ERR changeNodeRpcPassword', err); console.log('ERR changeNodeRpcPassword', err);
} }