mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
[fix] Parse options at beginning of setup
This commit is contained in:
@@ -960,7 +960,6 @@ parse_options() {
|
||||
proxy=$(echo "$1" | tr -d '"' | awk -F'--turbo=' '{print $2}')
|
||||
proxy_url="http://$proxy"
|
||||
TURBO="$proxy_url"
|
||||
use_turbo_proxy "$TURBO"
|
||||
else
|
||||
echo "turbo is not supported on this install type" >> $setup_log 2>&1
|
||||
fi
|
||||
@@ -1501,16 +1500,13 @@ update_packages() {
|
||||
}
|
||||
|
||||
use_turbo_proxy() {
|
||||
local proxy_url=$1
|
||||
#TODO: add options for username + pass
|
||||
|
||||
if [[ $OS == 'centos' ]]; then
|
||||
printf '%s\n' "proxy=${proxy_url}:3142" >> /etc/yum.conf
|
||||
printf '%s\n' "proxy=${TURBO}:3142" >> /etc/yum.conf
|
||||
else
|
||||
printf '%s\n'\
|
||||
"Acquire {"\
|
||||
" HTTP::proxy \"${proxy_url}:3142\";"\
|
||||
" HTTPS::proxy \"${proxy_url}:3142\";"\
|
||||
" HTTP::proxy \"${TURBO}:3142\";"\
|
||||
" HTTPS::proxy \"${TURBO}:3142\";"\
|
||||
"}" > /etc/apt/apt.conf.d/proxy.conf
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -40,6 +40,12 @@ export PATH=$PATH:../salt/common/tools/sbin
|
||||
date -u > $setup_log 2>&1
|
||||
|
||||
got_root
|
||||
|
||||
if [[ $# -gt 1 ]]; then
|
||||
set -- "${@:2}"
|
||||
parse_options "$@" >> $setup_log 2>&1
|
||||
fi
|
||||
|
||||
detect_os
|
||||
|
||||
if [ "$OS" == ubuntu ]; then
|
||||
@@ -241,9 +247,8 @@ fi
|
||||
|
||||
whiptail_make_changes
|
||||
|
||||
if [[ $# -gt 1 ]]; then
|
||||
set -- "${@:2}"
|
||||
parse_options "$@" >> $setup_log 2>&1
|
||||
if [[ -n "$TURBO" ]]; then
|
||||
use_turbo_proxy
|
||||
fi
|
||||
|
||||
if [[ "$setup_type" == 'iso' ]]; then
|
||||
|
||||
Reference in New Issue
Block a user