It worked for me until it didn’t for one particular switch. After troubleshooting I found out there was an error in the code; it didn’t need the line to go “high” since the 6 pins on that end are always high. Try this one:
Create a file called “/home/pi/scripts/shutdown.sh”
Inside the file, type.
Remember you still have to refer to this file in RC.local
ADD SCRIPT TO LOAD AT STARTUP BY ADDING COMMAND TO /ETC/RC.LOCAL:
sudo nano /etc/rc.local
TYPE THE FOLLOWING IN RC.LOCAL AFTER THE LINE “#By default this script does nothing”:
sudo /home/pi/scripts/shutdown.sh &
If you still can’t get it, I will email you the files.