Need Help creating shutdown shell script

Welcome Page Forums RetroPie Project Everything else related to the RetroPie Project Need Help creating shutdown shell script


This topic contains 7 replies, has 5 voices, and was last updated by  zigurana 2 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #107062


    Total noob and don’t really know what I’m doing. I’d love it if someone could help me with this.

    I want to be able to create a Shutdown option inside of my system menu. It will be in my list of ROMs so it will shutdown the system without having to use the EmulationStation menu. That way I can disable the Select and Start buttons in EmulationStation to make it childproof and not let anyone accidentally change my settings.

    In es_systems.cfg I changed NES to allow .sh extensions.

    <fullname>Nintendo Entertainment System</fullname>
    <extension>.nes .zip .NES .ZIP .sh</extension>
    <command>/opt/retropie/supplementary/runcommand/ 0 _SYS_ nes %ROM%</command>

    Now I would like to create a file to get it to turn the system off. I have no idea how to do that. I was hoping someone could help me out. I’m guessing it would look something like this only much better and actually functional:

    /sbin/shutdown -h -P now

    Can someone help me write this? Will it even work? Or am I way off track trying to set this up?



    Hmmm, this sounds like a good idea. If at all possible, I’d like to have the script shutdown in such a way that the ‘number of times played’ function in ES saves properly as well.




    I would love that as well. I’m trying to figure out if there is a way to quit Emulationstation that doesn’t involve F4 or using the EmulationStation GUI menu.



    This is entirely possible. It is something I am going to implement on my arcade cab when I get round to it, but I will be creating a ‘Power’ menu with its own theme etc. I will happily share when I have it up and running.

    The script I will use is:

    sudo poweroff

    It seems to shut the Pi down in the normal manner, however if anyone would care to correct me then go ahead – I could be wrong! I know there are shutdown commands to halt process etc. But the command above looks as though it halts the system the same as a normal shutdown via the emulation station ‘start menu’ would to me?




    I finally got round to creating a ‘Power’ option in Emulation Station. It works great from what I have tested so far.

    I have an idea of how I would like it to look and feel but I am terrible with graphics design so it is very basic looking at the moment.

    I will upload a video tonight and show you my idea, but basically I intend for there to be no gamelist inside the theme and instead only pictures of power and reboot buttons. Hope that makes sense but you will see what I mean in the video!




    OK as promised, here is a video of what I have set up:

    Need to sort out some decent looking power icons but otherwise it works great! It could also be used to create a custom script every time you shutdown, ie to switch a boot partition etc.

    If anyone artistic would care to create a set of good looking power buttons then that would be great!

    Let me know if you would like a copy of what I have so far.




    I just watched the video…Very nice, I like that a lot. Ya I’d love to see what you did. Now I’m not very Linux savvy so go easy.


Viewing 8 posts - 1 through 8 (of 8 total)

Forums are currently read only - please visit the new RetroPie forums at

PLEASE NOTE: All orders that are placed between January 14th and January 28th will be shipped on January 29th. Dismiss