Power & Source of Big Ideas

I would really like to know if there is any way to trigger a shutdown script
Good morning from germany! ;-) Just a question about the power button at the SATA HAT: how does it work? Is it like a hard shut off? I guess, if i want to power down the NanoPi M4 there are some things to do: close processes, clean write cache and so on - a regular shut down will take some time befo...