That's why I mentioned that it's far from perfected now ;)
I made it to prove it's possible to do for a prospect, but didn't have time to finish it. I might have given you my debug version of the script since my ssh credentials were the script, oops ;)
I will have a look at it again. The last thing I was working on was to include the line that matched. No support for regular expressions right now. I am not an expert on bash scripts, but it should be possible there.
It searches for a match of the string only. No and/or as it is now. As I mentioned, it was made as proof of concept but never finished.