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