@lackyluuk said in Push button (ON/OFF) script problems?:
The only scripts I use are two selfmade scripts for changing the system volume via gpio and a fan control. But I do not think this has an impact.
How do you do this? The gpio volume control? Could you post this script?
Also, I have OP's problem with crashing after installing the gpio on/off button with usb controller unpluging, as well as sometimes random.
@supernature2k said in Push button (ON/OFF) script problems?:
Some switches are very sensitive (especially old ones) and it can trigger some events when slightly moved.
I have the same problem with my NES power switch.
You can easily edit the script and change the function so that the button must be pressed x seconds to trigger the shutdown. it should solve this kind of problem.
D**n, THAT IS a useful comment 
How do I change the time to be longer? I think my gpio momentary switch might be picking up some signal from my speakers, wifi, light system, something....