This script enables the safe-shutdown and reset buttons on Retroflag's NesPi & SuperPi cases on OSMC and Raspbian. It is basically a stripped down version of ES-generic-shutdown by cyperghost to work on OSMC and Raspbian so all credit goes to him!
This makes the pi shutdown completely, including the fan!!!
For the original script for Retropi see:
https://github.com/crcerror/ES-generic-shutdown
http://retroflag.com/
Original Super Nespi case script: https://github.com/SNESPi/Super-NESPi-Case
Raspbian:
sudo apt-get install raspi-gpio
OSMC:
cd /usr/src && sudo wget https://github.com/Denisuu/OSMC_NesPi-SuperPi_Safe-Shutdown/raw/master/raspi-gpio-osmc.tar.gz && sudo tar -xvzf raspi-gpio-osmc.tar.gz && cd /usr/src/raspi-gpio && sudo apt-get install make gcc libc6-dev && sudo make install && cd /usr/src && sudo rm -r /usr/src/raspi-gpio/ raspi-gpio-osmc.tar.gz
Raspbian:
mkdir /home/pi/scripts && cd /home/pi/scripts && wget https://raw.githubusercontent.com/Denisuu/OSMC_NesPi-SuperPi_Safe-Shutdown/master/multi_switch.sh && chmod +x multi_switch.sh
OSMC:
mkdir /home/osmc/scripts && cd /home/osmc/scripts && wget https://raw.githubusercontent.com/m4rcSA/OSMC_NesPi-SuperPi_Safe-Shutdown/master/multi_switch.sh && chmod +x multi_switch.sh
Raspbian & OSMC:
sudo nano /etc/rc.local
Add the following line above exit 0
Raspbian:
/home/pi/scripts/multi_switch.sh --nespi+ & #Add this line above exit 0!
OSMC:
/home/osmc/scripts/multi_switch.sh --Super-NESPI & #Add this line above exit 0!
cd /lib/systemd/system-shutdown/ && sudo wget https://raw.githubusercontent.com/crcerror/ES-generic-shutdown/master/shutdown_fan && sudo chmod +x shutdown_fan