Thanks, however this leaves it in a state where it does not seem to power up when it recieves power which is a pain for what I’m trying to do. It also needs the button held for it to trigger the shutdown before it will then accept a button press to boot.

Is there anyway to simulate the button press so it shuts down “properly” to a state where it getting power will make it boot?

(I’m planning on leaving it in my car plugged in to a cable that’s only live when the engine is running, and have a script that shuts it down when it’s on battery/no wlan connections after X minutes).