From 4fc45ee29491835775972585ec26ea1a62dd4e39 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 18 Dec 2017 23:17:22 +0300 Subject: [PATCH] kmd rpcbind -> rpcport --- routes/shepherd/daemonControl.js | 38 +++++++++++++++++--------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/routes/shepherd/daemonControl.js b/routes/shepherd/daemonControl.js index 32f0c91..5c58e08 100644 --- a/routes/shepherd/daemonControl.js +++ b/routes/shepherd/daemonControl.js @@ -655,26 +655,28 @@ module.exports = (shepherd) => { }); } - const rpcbind = () => { + const rpcport = () => { return new Promise((resolve, reject) => { - const result = 'checking rpcbind...'; + const result = 'checking rpcport...'; - if (status[0].hasOwnProperty('rpcbind')) { - shepherd.log('rpcbind: OK'); - shepherd.writeLog('rpcbind: OK'); - } else { - shepherd.log('rpcbind: NOT FOUND'); - shepherd.writeLog('rpcbind: NOT FOUND'); + if (flock === 'komodod') { + if (status[0].hasOwnProperty('rpcport')) { + shepherd.log('rpcport: OK'); + shepherd.writeLog('rpcport: OK'); + } else { + shepherd.log('rpcport: NOT FOUND'); + shepherd.writeLog('rpcport: NOT FOUND'); - fs.appendFile(DaemonConfPath, '\nrpcbind=127.0.0.1', (err) => { - if (err) { - shepherd.writeLog(`append daemon conf err: ${err}`); - shepherd.log(`append daemon conf err: ${err}`); - } - // throw err; - shepherd.log('rpcbind: ADDED'); - shepherd.writeLog('rpcbind: ADDED'); - }); + fs.appendFile(DaemonConfPath, '\rpcport=7771', (err) => { + if (err) { + shepherd.writeLog(`append daemon conf err: ${err}`); + shepherd.log(`append daemon conf err: ${err}`); + } + // throw err; + shepherd.log('rpcport: ADDED'); + shepherd.writeLog('rpcport: ADDED'); + }); + } } resolve(result); @@ -764,7 +766,7 @@ module.exports = (shepherd) => { return rpcpass(); }) .then(server) - .then(rpcbind) + .then(rpcport) .then(addnode); });