CarPC ignition to trigger power on / off on GPIO
I'm very new to Raspberry Pi and Emteria. I have built a CarPC that will use Apple CarPlay with a CarlinKit dongle.
My goal is to turn the Pi on when I turn the ignition on, and shut it down safely when I turn the ignition off. As of now, the Pi is just always powered on.
I really have no clue on where to begin with this, other than connecting the ignition wire from my stereo wire harness onto the Pi's GPIOs.
I've read that I have to use sysfs to listen to the GPIO's, but how to write a script that can do the actions I want?