diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index edab825bc..94d868a88 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -12,5 +12,12 @@ BEGIN { while (server |& getline) { print $0 + if (match($0,"")) { + quit = "yes" + } + if (match($0,"") && match(quit,"yes")) { + close(server) + exit + } } } diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index a2ad423c6..039b98511 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -11,5 +11,12 @@ BEGIN { while (server |& getline) { print $0 + if (match($0,"")) { + quit = "yes" + } + if (match($0,"") && match(quit,"yes")) { + close(server) + exit + } } }