Fix awk pattern when checking if master exists