With these kinds of things, where you need to manage state (waiting, executing, failed, etc), it is very easy to miss a case or transition and generally better to rely on proven tech.
Let the waiting for network connection and retrying be done by systemd, half the internet runs on it. You can trust that it won’t mess that part up. Write only what is specific to you in your script.
With these kinds of things, where you need to manage state (waiting, executing, failed, etc), it is very easy to miss a case or transition and generally better to rely on proven tech.
Let the waiting for network connection and retrying be done by systemd, half the internet runs on it. You can trust that it won’t mess that part up. Write only what is specific to you in your script.