I have a logfile which I want to monitor and depending on which condition is met, different commands should be executed.
I found a solution that comes close to this here. Unfortunately it doesn't work for me and just gives me blank lines in the terminal.
xterm -e "$path_to_program | tee -a ${log_path}" &
tail -f ${log_path} | awk '/Initialization Sequence Completed/ { system("echo "VPN is running."") }
/[HOST_NOT_FOUND]/ { system("echo "error"") }
Are there other solutions that could help me with my problem?