Procd and infinite loop scripts

Dear team,

I have create a procd as per below.

#!/bin/sh /etc/rc.common

start_service() {
procd_set_param command /bin/sh "/root/scripts/latido/Wan1-latido"

The procd is enabled and symlink exists in /etc/rc.d/. When the device boots, process is running. Also script Wan1-latido it runs only for one time. Wan1-latido is a script which monitors a remote host and alters routes based on the results. Simple if-then-else code.

However, initially I tried to achieve the infinite loop with while do in the script, but since I want to run several copies (Wan2-latido, Wan3-latido, etc....) of this script based on the number of Wan interfaces I have, I found that it is not possible to run multiple demonized infinite loop scripts.

So the question is, I have the procd, the script which monitors the state of the remote host and I need to run the script in an infinite loop without using while-do in my code.

Any help or suggestion it will be highly appreciated.

Thank you,