Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added customizable poweroff command #1118

Merged

Conversation

miohna
Copy link
Contributor

@miohna miohna commented Oct 23, 2020

Adds an option to configure the poweroff command executed when
triggering a shutdown. Poweroff command to use is read from file
settings/Poweroff_Command, default sudo poweroff.

Scenario:

  • You are powering you Pi via an extension board, e.g. MoPi 2,
    that cannot detect a regular poweroff and stays powered-on itself. Via a
    customizable poweroff command you can trigger the extension board to
    power off the Pi in the prefered way which finally also turns-off the
    extension board.
  • You like to add some extras, e.g. LED illumination, on power off. A
    customizable poweroff command provides the "user" a nice hook for whatever
    stuff he likes to add before the actual power off :-)

Adds an option to configure the poweroff command executed when
triggering a shutdown. Poweroff command to use is read from file
`settings/Poweroff_Command`, default `sudo poweroff`.

Scenario:
a) You are powering you Pi via an extension board, e.g. MoPi 2,
that cannot detect a regular poweroff and stays powered-on itself. Via a
customizable poweroff command you can trigger the extension board to
power off the Pi in the prefered way which finally also turns-off the
extension board.
b) You like to add some extras, e.g. LED illumination, on power off. A
customizable poweroff command allows the "user" a nice hook for whatever
stuff he likes to add before the actual power off :-)
@Huseriato
Copy link

Cool idea. I checked you pull request. Looks fine. :)

@s-martin s-martin added this to the 2.2 milestone Oct 25, 2020
@MiczFlor
Copy link
Owner

HI @miohna
could you add this to the wiki, please? Ideally with other options? I think it should go into this section:
https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#other-relevant-files-in-the-settings-folder
And: IF there are a limited number of options, could you add them here in the thread? I will then make them part of the WebUI configuration page.
Thanks!

@MiczFlor MiczFlor merged commit 00b25df into MiczFlor:develop Oct 27, 2020
@miohna
Copy link
Contributor Author

miohna commented Oct 28, 2020

Wiki is updated: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#settingspoweroff_command

My use case is the MoPi2 board for which I need to power off the RPi via sudo mopicli -wsd 1 to get the board integrated smoothly. It could be a switch in the WebUI like for the RFID Reader, but I do not think that so many people currently using the MoPi2 as power interface for the Phoniebox. Therefore, it is probably not worth it to change the WebUI.

In general, I am sure there are many other options to use this feature for fun stuff.

@miohna miohna deleted the feature/develop/customizablePoweroffCommand branch October 28, 2020 20:22
@MiczFlor
Copy link
Owner

Thanks @miohna , you are the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants