diff --git a/script/configure-web-proxy b/script/configure-web-proxy index e9297e5a557d..2c4fa676cd65 100755 --- a/script/configure-web-proxy +++ b/script/configure-web-proxy @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e usage() { cat << EOF @@ -18,7 +18,7 @@ eval set -- "$opts" web_proxy="apache" while true; do case "$1" in - -h | --help ) usage 0; shift ;; + -h | --help ) usage 0 ;; -p | --proxy ) web_proxy=${2#*=}; shift ;; -- ) shift; break ;; * ) break ;; @@ -27,11 +27,11 @@ done sed -i -e 's/^.*httpsonly.*$/httpsonly = 0/g' /etc/openqa/openqa.ini -if [ "$web_proxy" = "nginx" ] ; then +if [[ $web_proxy == "nginx" ]] ; then echo "Setting up nginx" sed "s/openqa.example.com/$(hostname)/" /etc/nginx/vhosts.d/openqa.conf.template > /etc/nginx/vhosts.d/openqa.conf sed -i -e "s/\(^[^#]*server_name localhost;\)/#\1/" /etc/nginx/nginx.conf -elif [ "$web_proxy" = "apache" ] || [ "$web_proxy" = "apache2" ] ; then +elif [[ $web_proxy == "apache" ]] || [[ $web_proxy == "apache2" ]] ; then echo "Setting up apache" for i in headers proxy proxy_http proxy_wstunnel rewrite ; do a2enmod $i ; done sed "s/#ServerName.*$/ServerName $(hostname)/" /etc/apache2/vhosts.d/openqa.conf.template > /etc/apache2/vhosts.d/openqa.conf