UNPKG

the-shepherd

Version:
32 lines (27 loc) 804 B
// Generated by CoffeeScript 2.5.1 (function() { var $, Daemon, echo, echoResponse; ({$, echo, echoResponse} = require('../common')); Daemon = require('../daemon'); Object.assign(module.exports, { options: [], toMessage: function(cmd) { return { c: 'down' }; }, onResponse: echoResponse, onMessage: function(msg, client, cb) { var client_echo; client_echo = function(msg) { echo("src/action/down", msg); return client != null ? client.write($.TNET.stringify(msg)) : void 0; }; client_echo("Shutting down..."); return Daemon.doStop(true, client, function(err, acted) { client_echo("Stopped."); return typeof cb === "function" ? cb(null, acted) : void 0; }); } }); }).call(this);