Restart node-RED via dashboard

Just tried running node-red-restart through an exec node, and it works well. It shuts down and restarts gracefully according to NR log. (Raspberry Pi installed via official install script)
Useful to use remotely or to restart NR after updating nodes, without resorting to cmd prompt.

restart

[{"id":"8497fd50.d66e1","type":"exec","z":"4487e413.bb781c","command":"sudo ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"System Command","x":720,"y":370,"wires":[[],[],[]]},{"id":"c8687228.7cd88","type":"inject","z":"4487e413.bb781c","name":"Restart node-RED","topic":"","payload":"node-red-restart","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":370,"wires":[["8497fd50.d66e1"]]}]
6 Likes