Hi there!

The X1008 can automatically turn off SATA devices when the Pi 5 is powered down, so no extra script is needed.