From 7b05af1dd78fd1106c466a9cf690f62043ea7066 Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Mon, 30 Aug 2021 10:03:50 +0200 Subject: [PATCH] Fix awk expression The original awk '/WSGIScriptAlias/ {print $2}' could match multiple lines as well as other configuration values, like WSGIScriptAliasMatch. This fixes the matched string to include a space as well as to exit after the first match. Closes-Bug: #1942057 Resolves: rhbz#1954374 Change-Id: Ie8769230d6181b1b9fca4e60678ae9575c151c9f (cherry picked from commit 64cf73a3c937877d9d525fb694e7ce86cc229f63) --- healthcheck/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/healthcheck/common.sh b/healthcheck/common.sh index 300b50b49..e6c5f68d9 100755 --- a/healthcheck/common.sh +++ b/healthcheck/common.sh @@ -128,7 +128,7 @@ get_url_from_vhost () { server_name=$(awk '/ServerName/ {print $2}' $vhost_file) ssl_enabled=$(awk '/SSLEngine/ {print $2}' $vhost_file) bind_port=$(grep -h "" $vhost_file | sed 's//\1/') - wsgi_alias=$(awk '/WSGIScriptAlias/ {print $2}' $vhost_file) + wsgi_alias=$(awk '/WSGIScriptAlias / {print $2; exit}' $vhost_file) proto=http if [[ $ssl_enabled == "on" ]]; then proto=https