[fix] Test install type after it has been set

This commit is contained in:
William Wernert
2020-05-26 16:23:06 -04:00
parent 001f7c6694
commit ec0ec79470

View File

@@ -955,14 +955,10 @@ node_pillar() {
parse_options() { parse_options() {
case "$1" in case "$1" in
--turbo=*) --turbo=*)
if [[ $is_master || $is_helix ]]; then local proxy
local proxy proxy=$(echo "$1" | tr -d '"' | awk -F'--turbo=' '{print $2}')
proxy=$(echo "$1" | tr -d '"' | awk -F'--turbo=' '{print $2}') proxy_url="http://$proxy"
proxy_url="http://$proxy" TURBO="$proxy_url"
export TURBO="$proxy_url"
else
echo "turbo is not supported on this install type" >> $setup_log 2>&1
fi
;; ;;
--proxy=*) --proxy=*)
local proxy local proxy
@@ -971,7 +967,7 @@ parse_options() {
local proxy_protocol local proxy_protocol
proxy_protocol=$(echo "$proxy" |tr -d '"' | awk 'match($0, /http|https/) { print substr($0, RSTART, RLENGTH) }') proxy_protocol=$(echo "$proxy" |tr -d '"' | awk 'match($0, /http|https/) { print substr($0, RSTART, RLENGTH) }')
if [[ ! $proxy_protocol =~ ^(http|https) ]]; then if [[ ! $proxy_protocol =~ ^(http|https)$ ]]; then
echo "Invalid proxy protocol" echo "Invalid proxy protocol"
echo "Ignoring proxy" echo "Ignoring proxy"
return return
@@ -1500,6 +1496,11 @@ update_packages() {
} }
use_turbo_proxy() { use_turbo_proxy() {
if [[ ! $install_type =~ ^(MASTER|EVAL|HELIXSENSOR|MASTERSEARCH|STANDALONE)$ ]]; then
echo "turbo is not supported on this install type" >> $setup_log 2>&1
return
fi
if [[ $OS == 'centos' ]]; then if [[ $OS == 'centos' ]]; then
printf '%s\n' "proxy=${TURBO}:3142" >> /etc/yum.conf printf '%s\n' "proxy=${TURBO}:3142" >> /etc/yum.conf
else else