You can just use the "infinity of sleep." If you want to perform more actions on shutdown and do not want to create a function for this, an alternative could be:
#!/bin/bash sleep infinity & PID=$! trap "kill $PID" INT TERM echo starting
Another alternative to "infinity of sleep" (for example, busybox does not support it, for example) could be, for example, "tail -fn0 $ 0".
source share