Stop OH and then Shutdown or Reboot Raspberry from Sitemap

Hi,

i am searching for a way to make it.
I have made a bash with

sudo service openhab2 stop && sudo reboot

or

sudo service openhab2 stop && sudo /sbin/shutdown -h now

granted priveleges. It only stops OH, but not restart or shutdown Raspi.

How it can be made?

Thanks a lot!

Have a look at this topic Beginner's guide to an openHABian reboot/shutdown switch and read all the post.:wink:

1 Like

Thanks!
I have read it, but it seems to be not a solution, because as i understood, it can execute only one command, in my case i have 4.
So is there a way?

PS
I find it not good idea to reboot raspi without stopping OH and sometimes i need to clean a cache.

Thanks!