pimoroni / clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
MIT License
126 stars 39 forks source link

Howto initiate the via PHP #16

Closed gusmax777 closed 5 years ago

gusmax777 commented 5 years ago

Hi.

Is there any way to initiate the clean shutdown via the console or a python or PHP script? I have a project on my Pi that has his own shutdown button in the Webgui. If I use the built in button in the gui the Pi shuts down but without ending in a clean state.

Cheers, Thomas

Gadgetoid commented 5 years ago

There's no real reason for "clean-shutdown" to be involved at all if you're using another programming language to trigger a shutdown.

PHP, for example, should just be able to shell-exec a sudo shutdown -h now command and - while in many programming applications such an approach would be frowned upon - it might just well do the trick in your case.