I have a Gertboard rev1 and I was wondering if there was an easy way to make the pushbuttons serve as a restart button and/or a halt button.
I have managed to open up buttons.c (from the gertboard_sw package) which loops and checks the button GPIO status ... and I can determine which pushbutton is pressed but then I'm not sure how to reboot/halt the system in C. I'd like to do 'shutdown -r now' if one button is pressed, and 'shutdown -h now' if another is pressed.
This would be extremely useful as I am running a headless RasPi.