























Yea, i'm a sucker for the Raspberry Pi3 these days and using them as mini media servers and retro gaming consoles. I had originally gotten the NesPi case that had both power and reset buttons but the buttons were hard power offs/resets vs an os initiated reboot/shutdown. Hard powering off/resetting a raspberry pi running can correct the sdcard and basically make it not boot and require one to do the full re-install.Enter the new NESPi case by RetroFlag (amazon link, i do not make anything on these! https://www.amazon.com/gp/product/B07BRHDVTN However after buying my NesPi case, I realized I am running OSMC vs RetroPie or Recallbox. I initially tried using both the scripts that RetroFlag created in OSMC via putty/ssh but neither worked due to the linux distro of OSMC being diff than those two. So I then attempted to use the MSLDigital scripts I had used for my RemotePi module since it seemed they were using the same GPIO pins on the board. After about 2 hours of rebuilding my OSMC setup (kept putting my osmc build into a reboot loop upon reboot), i decided that script was a dead end no matter what tweaks i made.Finally, i ran across a script by Rern on the OSMC forums , full/original post here and full props to them for this. I have modified this to work w/the power button in OSMC and if you have added RetroPie it will savemetadata before the shutdown.I use putty to SSH into my pi. Here are the steps. (link to actual code page: https://gist.github.com/seamonkey420/8810318ba9c91dc238771c2459effce4 --You can also create seperate service so that the reset button will then reboot the pi too. Just change button 3 and use resetbutton.py and resetbutton.service and be sure to ref .py script in the .service file. ;)