diff --git a/app/modules/daemon.js b/app/modules/daemon.js index b228bbe34157a06966568bb284eefcb4ed9c9897..f572511ddd174bed8afea900cf03c69c9d089891 100644 --- a/app/modules/daemon.js +++ b/app/modules/daemon.js @@ -29,6 +29,11 @@ module.exports = { return new Promise(() => null); // Never ending }) + },{ + name: 'status', + desc: 'Show Duniter node daemon status.', + logs: false, + onConfiguredExecute: (server) => needsToBeLaunchedByScript(server.logger) },{ name: 'stop', desc: 'Stop Duniter node daemon.', diff --git a/bin/daemon b/bin/daemon index b206f425e6fb1ea450ec039a8d5fbb2902f8e934..723c50b7b26064ca17680fcd7f72df8278793aa7 100755 --- a/bin/daemon +++ b/bin/daemon @@ -17,6 +17,14 @@ switch (process.argv[2]) { daemon.stop(); break; + case "status": + if (daemon.status()) { + console.log('Duniter daemon status: running'); + } else { + console.log('Duniter daemon status: stopped'); + } + break; + case "sync": case "reset": const command = process.argv[2]; diff --git a/duniter.sh b/duniter.sh index 00edd7b18874f9b93789ba189ff671d232e014bc..c3f7f993eaac164d2cbe4ae756d355cbaa5165e6 100755 --- a/duniter.sh +++ b/duniter.sh @@ -45,7 +45,7 @@ duniter() { # DUNITER DAEMON MANAGEMENT #--------------------------------- - reset|start|stop|restart|webstart|webrestart) + reset|start|stop|status|restart|webstart|webrestart) $NODE "$DUNITER_DIR/bin/daemon" $* ;;