[fix] Double quote variables + fix indents

This commit is contained in:
William Wernert
2020-04-18 18:06:30 -04:00
parent 56326026b7
commit 2127924066
2 changed files with 404 additions and 399 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -17,8 +17,8 @@
# Source the other pieces of the setup # Source the other pieces of the setup
SCRIPTDIR=$(dirname "$0") SCRIPTDIR=$(dirname "$0")
source $SCRIPTDIR/so-functions source "$SCRIPTDIR/so-functions"
source $SCRIPTDIR/so-whiptail source "$SCRIPTDIR/so-whiptail"
# See if this is an ISO install # See if this is an ISO install
OPTIONS=$1 OPTIONS=$1
@@ -44,16 +44,16 @@ SETUPLOG="/root/sosetup.log"
# End Global Variables # End Global Variables
# Reset the Install Log # Reset the Install Log
date -u >$SETUPLOG 2>&1 date -u > $SETUPLOG 2>&1
echo "stty size is: $(stty size)" >> $SETUPLOG 2>&1 echo "stty size is: $(stty size)" >> $SETUPLOG 2>&1
# Check for prerequisites # Check for prerequisites
got_root got_root
detect_os detect_os
if [ $OS == ubuntu ]; then if [ "$OS" == ubuntu ]; then
# Override the horrible Ubuntu whiptail color pallete # Override the horrible Ubuntu whiptail color pallete
update-alternatives --set newt-palette /etc/newt/palette.original update-alternatives --set newt-palette /etc/newt/palette.original >> $SETUPLOG 2>&1
fi fi
# Question Time # Question Time
@@ -61,7 +61,7 @@ echo "Asking user if they are sure they want to proceed" >> $SETUPLOG 2>&1
if (whiptail_you_sure) ; then if (whiptail_you_sure) ; then
# Create a temp dir to get started # Create a temp dir to get started
install_prep install_prep >> $SETUPLOG 2>&1
setterm -blank 0 setterm -blank 0
if [ $INSTALLMETHOD == network ]; then if [ $INSTALLMETHOD == network ]; then
@@ -84,7 +84,7 @@ if (whiptail_you_sure) ; then
whiptail_dhcp_or_static whiptail_dhcp_or_static
# Do this if it static is selected # Do this if it static is selected
if [ $ADDRESSTYPE != 'DHCP' ]; then if [ "$ADDRESSTYPE" != 'DHCP' ]; then
whiptail_management_interface_ip whiptail_management_interface_ip
whiptail_management_interface_mask whiptail_management_interface_mask
whiptail_management_interface_gateway whiptail_management_interface_gateway
@@ -114,8 +114,8 @@ if (whiptail_you_sure) ; then
# What kind of install are we doing? # What kind of install are we doing?
whiptail_install_type whiptail_install_type
SHORTNAME=$(echo $HOSTNAME | awk -F. {'print $1'}) SHORTNAME=$(echo "$HOSTNAME" | awk -F. '{print $1}')
MINION_ID=$(echo $SHORTNAME'_'$INSTALLTYPE | tr '[:upper:]' '[:lower:]') MINION_ID=$(echo "$SHORTNAME'_'$INSTALLTYPE" | tr '[:upper:]' '[:lower:]')
echo "MINION_ID = $MINION_ID" >> $SETUPLOG 2>&1 echo "MINION_ID = $MINION_ID" >> $SETUPLOG 2>&1
# How do we want to handle OS patching? manual, auto or scheduled days and hours # How do we want to handle OS patching? manual, auto or scheduled days and hours
@@ -130,10 +130,10 @@ if (whiptail_you_sure) ; then
'Import Schedule') 'Import Schedule')
whiptail_patch_schedule_import whiptail_patch_schedule_import
;; ;;
Automatic) 'Automatic')
PATCHSCHEDULENAME=auto PATCHSCHEDULENAME=auto
;; ;;
Manual) 'Manual')
PATCHSCHEDULENAME=manual PATCHSCHEDULENAME=manual
;; ;;
esac esac
@@ -141,21 +141,23 @@ if (whiptail_you_sure) ; then
#################### ####################
## Helix ## ## Helix ##
#################### ####################
if [ $INSTALLTYPE == 'HELIXSENSOR' ]; then if [ $"INSTALLTYPE" == 'HELIXSENSOR' ]; then
MASTERUPDATES=OPEN MASTERUPDATES=OPEN
filter_unused_nics filter_unused_nics
[[ $SKIP_BOND != 'yes' ]] && whiptail_bond_nics [[ "$SKIP_BOND" != 'yes' ]] && whiptail_bond_nics
whiptail_helix_apikey whiptail_helix_apikey
whiptail_homenet_master whiptail_homenet_master
RULESETUP=ETOPEN RULESETUP=ETOPEN
NSMSETUP=BASIC NSMSETUP=BASIC
HNSENSOR=inherit HNSENSOR=inherit
LS_HEAP_SIZE="1000m" LS_HEAP_SIZE="1000m"
calculate_useable_cores calculate_useable_cores >> "$SETUPLOG" 2>&1
whiptail_make_changes whiptail_make_changes
set_hostname {
set_version set_hostname;
clear_master set_version;
clear_master;
} >> "$SETUPLOG" 2>&1
mkdir -p /nsm mkdir -p /nsm
get_filesystem_root get_filesystem_root
get_filesystem_nsm get_filesystem_nsm
@@ -276,7 +278,7 @@ if (whiptail_you_sure) ; then
#################### ####################
## Master ## ## Master ##
#################### ####################
if [ $INSTALLTYPE == 'MASTER' ]; then if [ "$INSTALLTYPE" == 'MASTER' ]; then
# Would you like to do an advanced install? # Would you like to do an advanced install?
whiptail_master_adv whiptail_master_adv
@@ -294,7 +296,7 @@ if (whiptail_you_sure) ; then
whiptail_rule_setup whiptail_rule_setup
# Get the code if it isn't ET Open # Get the code if it isn't ET Open
if [ $RULESETUP != 'ETOPEN' ]; then if [ "$RULESETUP" != 'ETOPEN' ]; then
# Get the code # Get the code
whiptail_oinkcode whiptail_oinkcode
fi fi
@@ -305,9 +307,9 @@ if (whiptail_you_sure) ; then
process_components process_components
# Do Advacned Setup if they chose it # Do Advacned Setup if they chose it
if [ $MASTERADV == 'ADVANCED' ]; then if [ "$MASTERADV" == 'ADVANCED' ]; then
# Ask which bro logs to enable - Need to add Suricata check # Ask which bro logs to enable - Need to add Suricata check
if [ $BROVERSION != 'SURICATA' ]; then if [ "$BROVERSION" != 'SURICATA' ]; then
whiptail_master_adv_service_brologs whiptail_master_adv_service_brologs
fi fi
fi fi
@@ -315,7 +317,7 @@ if (whiptail_you_sure) ; then
# Get a password for the soremote user # Get a password for the soremote user
whiptail_create_soremote_user whiptail_create_soremote_user
SCMATCH=no SCMATCH=no
while [ $SCMATCH != yes ]; do while [ "$SCMATCH" != 'yes' ]; do
whiptail_create_soremote_user_password1 whiptail_create_soremote_user_password1
whiptail_create_soremote_user_password2 whiptail_create_soremote_user_password2
check_soremote_pass check_soremote_pass