Automatically update a Linux firewall (ufw) with DNS look up results

At last access to a PC !

For those that are able to test it, I'd be interested to hear what you see to be the cause of the difference, it looks to me to be a space is added between the command in the exec node and the payload. (and i can't remove it)

[{"id":"ffdd1306.1f1d8","type":"dns","z":"d223a8f0.30c528","name":"Lookup IP","method":"lookup","x":610,"y":700,"wires":[["9f70e27.23feba","17c6c980.56fb07","16345658.7a4ed2"]]},{"id":"9f70e27.23feba","type":"debug","z":"d223a8f0.30c528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":810,"y":640,"wires":[]},{"id":"17c6c980.56fb07","type":"template","z":"d223a8f0.30c528","name":"curl https://ipvigilante.com/{{payload}}","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"curl https://ipvigilante.com/{{payload}}","output":"str","x":670,"y":780,"wires":[["178e0c6c.b5050c"]]},{"id":"16345658.7a4ed2","type":"exec","z":"d223a8f0.30c528","command":"curl https://ipvigilante.com/","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":860,"y":700,"wires":[["c29ecee8.21451"],[],[]]},{"id":"c29ecee8.21451","type":"debug","z":"d223a8f0.30c528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1090,"y":700,"wires":[]},{"id":"810e8feb.0b8018","type":"debug","z":"d223a8f0.30c528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1090,"y":780,"wires":[]},{"id":"178e0c6c.b5050c","type":"exec","z":"d223a8f0.30c528","command":"","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":930,"y":780,"wires":[["810e8feb.0b8018"],[],[]]},{"id":"9fcbe2f1.cef7d8","type":"inject","z":"d223a8f0.30c528","name":"google.com","topic":"","payload":"google.com","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":450,"y":700,"wires":[["ffdd1306.1f1d8"]]}]

you are correct.

Thanks dceejay

:slight_smile: so is that expected then ?

Are you not able to pass command line entries via an inject node ?

Yes it expected - the parameters for a command are appended using a space to separate them. If you want them as one parameter you need to concatenate them yourself as you have done with the template (or using a function node).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.