Home Assistant - Router Reboot with Ping, EXEC and SSH

The exit code for success (in the exec node) is 0, anything else is not good.

But I am not sure what your flow is doing. You have a ping node, switch, delay and an exec node that pings again (?)

Try this flow:

[{"id":"d0e65ce4.139f68","type":"inject","z":"c7a7f9b9.d798d8","name":"","topic":"","payload":"","payloadType":"date","repeat":"600","crontab":"","once":true,"onceDelay":0.1,"x":214,"y":528,"wires":[["6c3b9a6e.1bc3ac"]]},{"id":"6c3b9a6e.1bc3ac","type":"exec","z":"c7a7f9b9.d798d8","command":"ping -c1 google.com","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":412,"y":528,"wires":[[],[],["5604c714.79324"]]},{"id":"1362fae2.70de5d","type":"debug","z":"c7a7f9b9.d798d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":480,"wires":[]},{"id":"5604c714.79324","type":"switch","z":"c7a7f9b9.d798d8","name":"success ?","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":612,"y":528,"wires":[["1362fae2.70de5d"],[]]}]

I did not include the ssh client as I am not familiair with it.