How to execute a command from my rules file?

Hello, so I need to execute a command

sudo reboot

in my rules file so here is what I’m working with

rule "raspi reboot"
when 
Item raspirr received update
then
//Right here i need to execute "sudo reboot"
end

Any help will be highly appreciated. :slight_smile:

Would the EXEC binding work here?

Check out this thread

Could you give me a detailed guide how to use it? I’m new with the Exec Binding
And I would rather prefer doing it in the rules something like executeCommandLine(“sudo reboot”)

So have you actually tried doing that?

http://docs.openhab.org/addons/bindings/exec/readme.html

With either approach, when you encounter problems:

1 Like

Yes, I have and I also tried doing this


didn’t seem to work.