Revert "Revert "Search line with awk itself and avoid grep""

This commit was causing all tripleo ironic CI jobs to fail, this is
because every time we change a ssh string we need to first whitelist
it in the TripleO CI. Now the TripleO environment is ajusted and this
patch can be merged again.

The fix for the TripleO CI: https://review.openstack.org/#/c/120799/

Co-Authored-By: Motohiro OTSUKA <ootsuka@mxs.nes.nec.co.jp>
Change-Id: I60936ac36f4aa3810679c9f2420a29ae072dfb8a
Merge "Revert "Revert "Search line with awk itself and avoid grep"""