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 64cf73a3c9)
This commit is contained in:
Grzegorz Grasza 2021-08-30 10:03:50 +02:00
parent b089c55c2c
commit febd29b449
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,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 "<VirtualHost .*>" $vhost_file | sed 's/<VirtualHost .*:\(.*\)>/\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