Script bash automatic

Hello,
I want to run a bash script automatically when starting the FX-30 but also remains active as long as the FX-30 is running (bash script with an uninitiated while loop).
I know that I will be able to do it through a Legato application but if there is other way I am interested to know it.
How can I do that? I get there on raspberry but impossible on the FX-30. I found different topic on the forum but it only explained how to do some instructions at startup.

Thanking you

Valentin

Yoy can modify /etc/init.d/startlegato.sh to add your script.