I try to do something similar already discussed here: Starting Script at Shutdown wont work after Upgrade to OSMC
My raspberry is powered by a wireless socket which I can control with a remote. After a shutdown down, I can use the remote to power off and power on the raspberry again.
I can control any wireless socket also from my raspberry using a 433MHz sender. That works.
What I try to do is to power off the raspberry automatically after shutdown. On shutdown, when the script to power off the socket is run, the raspberry would immediately go off. That could damage the file system I guess.
Would something work like: On the shutdown process, after unmounting the file systems, a script or something should mount the file system again as read-only and call the power-off script. That way it should be safe to power off the raspberry.
What do you think, is that possible? Any suggestions/thoughts?
Thanks in advance.