ea1abz%gmail.com@localhost (Ramiro Aceves) writes:
My script says on the console "Network connectivity to $TARGET is OK."
several times before the script dies. So ping works fine. (I have set
INTERVAL=3 seconds just to speed things up during testing.
Your script shouldn't create output from a background process.
When booting, output is piped through a logging process, and when
that exits, the next output will abort your process.
nohup doesn't help, it only redirects terminal output.
Ideally you should not print anything directly in a background
process but write a log file (or use logger / syslog).
To avoid any accidential problem, you should also redirect all
three standard handles (e.g. to /dev/null).
N.B. the connectivity check is a bit sensitive. I suggest to
probe with more than 1 packet and to also set a deadline (-w)
which allows for one extra second, e.g. ping -n -c 3 -w 4.