A process in a bash script I'm developing often fails quietly (it keeps running with no error code, but it writes the error in its log file).
As soon as the error appears in the log file I want the process restarted (and the monitoring of the log file continued too). When the process finishes I want the rest of the script to run.
I've searched a lot and I've tried a lot of things with grep and tail, and if, while, pipes etc, but I simply can't get it working.
What is the proper way?
Here's what I basically want, in an imaginary language (not bash/shell):
:START
RUN error_prone_process
IF "Error text" ~/logfile.txt
KILL error_prone_process
GOTO START