Page 1 of 1

Disable "Restart/Shutdown System" buttons?

Posted: Monday 21 December 2015 18:50
by georgep
Is there any way (short of me digging into the code and hacking it myself) of disabling or removing the two "More Options -> Shutdown System/Restart System" buttons in the web interface?

I have found them really useful on my RPi, but now that I'm setting up Domoticz on a server with lots of other functionality I've already accidentally shut down the server once :o :oops:

A compile-time option or maybe a command-line switch would be just perfect IMHO.

George

Re: Disable "Restart/Shutdown System" buttons?

Posted: Monday 21 December 2015 19:17
by Egregius
The buttons are created in www/index.html

Code: Select all

<li id="mRestart"><a id="cRestart" href="javascript:SwitchLayout('Restart')"><img src="images/restart.png"> <span data-i18n="Restart System">Restart System</span></a></li>
<li id="mShutdown"><a id="cShutdown" href="javascript:SwitchLayout('Shutdown')"><img src="images/shutdown.png"> <span data-i18n="Shutdown System">Shutdown System</span></a></li>
Looking at their structure I would say it's safe to just delete those lines or place them in comment by adding <!-- in front and --> after them.

Re: Disable "Restart/Shutdown System" buttons?

Posted: Tuesday 22 December 2015 10:01
by georgep
Egregius wrote:The buttons are created in www/index.html
Looking at their structure I would say it's safe to just delete those lines or place them in comment by adding <!-- in front and --> after them.
Great! Thanks for that.
I don't have time to test it right now but that seems like a good solution.
George

Re: Disable "Restart/Shutdown System" buttons?

Posted: Tuesday 22 December 2015 15:18
by mbliek
It works. Did it myself. I'm using a Domoticz system as demo for my webshop. But every time demo users at shutting the system down

Re: Disable "Restart/Shutdown System" buttons?

Posted: Tuesday 03 December 2019 17:44
by leecollings
Better still, change the functionality of the Shutdown system so that it just stops the Domoticz service rather than shutdown the entire Pi.

I thought it would just stop the Domoticz service...nope. :(