mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	| @@ -50,9 +50,9 @@ module.exports = function(RED) { | ||||
|                         if (node.cr === true) { msg.payload += "\n"; } | ||||
|                     } | ||||
|                     node.debug("inp: "+msg.payload); | ||||
|                     lastmsg = msg; | ||||
|                     if (node.child !== null && node.running) { node.child.stdin.write(msg.payload); } | ||||
|                     else { node.warn(RED._("daemon.errors.notrunning")); } | ||||
|                     lastmsg = msg; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| @@ -65,7 +65,7 @@ module.exports = function(RED) { | ||||
|             } | ||||
|             let args = node.args; | ||||
|             if (appendArgs !== undefined && appendArgs.length > 0) { | ||||
|               args = args.concat(appendArgs); | ||||
|                 args = args.concat(appendArgs); | ||||
|             } | ||||
|  | ||||
|             try { | ||||
| @@ -120,6 +120,12 @@ module.exports = function(RED) { | ||||
|                     else { node.log('error: ' + err); } | ||||
|                     node.status({fill:"red",shape:"ring",text:RED._("daemon.status.error")}); | ||||
|                 }); | ||||
|  | ||||
|                 node.child.stdin.on('error', function (err) { | ||||
|                     if (err.errno === "EPIPE") { node.error(RED._("daemon.errors.pipeclosed"),lastmsg); } | ||||
|                     else { node.log('error: ' + err); } | ||||
|                     node.status({fill:"red",shape:"ring",text:RED._("daemon.status.error")}); | ||||
|                 }); | ||||
|             } | ||||
|             catch(e) { | ||||
|                 if (e.errno === "ENOENT") { node.warn(RED._("daemon.errors.notfound")); } | ||||
|   | ||||
| @@ -37,7 +37,8 @@ | ||||
|             "notrunning": "Command not running", | ||||
|             "notfound": "Command not found", | ||||
|             "notexecutable": "Command not executable", | ||||
|             "restarting": "Restarting" | ||||
|             "restarting": "Restarting", | ||||
|             "pipeclosed": "Process closed" | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|     "name"          : "node-red-node-daemon", | ||||
|     "version"       : "0.5.0", | ||||
|     "version"       : "0.5.1", | ||||
|     "description"   : "A Node-RED node that runs and monitors a long running system command.", | ||||
|     "dependencies"  : { | ||||
|     }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user