mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-01-23 16:33:29 +01:00
SO Setup - Fix alphabetic order for functions
This commit is contained in:
@@ -26,20 +26,6 @@ LISTCORES=$(cat /proc/cpuinfo | grep processor | awk '{print $3 " \"" "core" "\"
|
||||
|
||||
# Functions
|
||||
|
||||
calculate_useable_cores() {
|
||||
|
||||
# Calculate reasonable core usage
|
||||
local CORES4BRO=$(( $CPUCORES/2 - 1 ))
|
||||
LBPROCSROUND=$(printf "%.0f\n" $CORES4BRO)
|
||||
# We don't want it to be 0
|
||||
if [ "$LBPROCSROUND" -lt 1 ]; then
|
||||
LBPROCS=1
|
||||
else
|
||||
LBPROCS=$LBPROCSROUND
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
accept_salt_key_local() {
|
||||
|
||||
# Accept the key locally on the master
|
||||
@@ -84,6 +70,20 @@ add_socore_user_notmaster() {
|
||||
|
||||
}
|
||||
|
||||
calculate_useable_cores() {
|
||||
|
||||
# Calculate reasonable core usage
|
||||
local CORES4BRO=$(( $CPUCORES/2 - 1 ))
|
||||
LBPROCSROUND=$(printf "%.0f\n" $CORES4BRO)
|
||||
# We don't want it to be 0
|
||||
if [ "$LBPROCSROUND" -lt 1 ]; then
|
||||
LBPROCS=1
|
||||
else
|
||||
LBPROCS=$LBPROCSROUND
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
chown_salt_master() {
|
||||
|
||||
# Chown the salt dirs on the master for socore
|
||||
@@ -219,6 +219,26 @@ detect_os() {
|
||||
|
||||
}
|
||||
|
||||
docker_install() {
|
||||
|
||||
if [ $INSTALLTYPE == 'MASTERONLY' ] || [ $INSTALLTYPE == 'EVALMODE' ]; then
|
||||
apt-get update >>~/sosetup.log 2>&1
|
||||
apt-get -y install docker-ce >>~/sosetup.log 2>&1
|
||||
docker_registry
|
||||
echo "Restarting Docker"
|
||||
systemctl restart docker
|
||||
else
|
||||
apt-key add $TMP/gpg/docker.pub
|
||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
apt-get update >>~/sosetup.log 2>&1
|
||||
apt-get -y install docker-ce >>~/sosetup.log 2>&1
|
||||
docker_registry
|
||||
echo "Restarting Docker"
|
||||
systemctl restart docker
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
docker_registry() {
|
||||
|
||||
echo "Setting up Docker Registry"
|
||||
@@ -449,33 +469,6 @@ saltify() {
|
||||
|
||||
}
|
||||
|
||||
docker_install() {
|
||||
|
||||
if [ $INSTALLTYPE == 'MASTERONLY' ] || [ $INSTALLTYPE == 'EVALMODE' ]; then
|
||||
apt-get update >>~/sosetup.log 2>&1
|
||||
apt-get -y install docker-ce >>~/sosetup.log 2>&1
|
||||
docker_registry
|
||||
echo "Restarting Docker"
|
||||
systemctl restart docker
|
||||
else
|
||||
apt-key add $TMP/gpg/docker.pub
|
||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
apt-get update >>~/sosetup.log 2>&1
|
||||
apt-get -y install docker-ce >>~/sosetup.log 2>&1
|
||||
docker_registry
|
||||
echo "Restarting Docker"
|
||||
systemctl restart docker
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
salt_firstcheckin() {
|
||||
|
||||
#First Checkin
|
||||
salt-call state.highstate >>~/sosetup.log 2>&1
|
||||
|
||||
}
|
||||
|
||||
salt_checkin() {
|
||||
# Master State to Fix Mine Usage
|
||||
if [ $INSTALLTYPE == 'MASTERONLY' ]; then
|
||||
@@ -510,6 +503,13 @@ salt_checkin_message() {
|
||||
|
||||
}
|
||||
|
||||
salt_firstcheckin() {
|
||||
|
||||
#First Checkin
|
||||
salt-call state.highstate >>~/sosetup.log 2>&1
|
||||
|
||||
}
|
||||
|
||||
salt_master_directories() {
|
||||
|
||||
# Create salt paster directories
|
||||
@@ -587,22 +587,6 @@ set_initial_firewall_policy() {
|
||||
|
||||
}
|
||||
|
||||
set_updates() {
|
||||
|
||||
if [ $MASTERUPDATES == 'MASTER' ]; then
|
||||
if [ $OS == 'centos' ]; then
|
||||
echo "proxy=http://$MSRV:3142" >> /etc/yum.conf
|
||||
|
||||
else
|
||||
|
||||
# Set it up so the updates roll through the master
|
||||
echo "Acquire::http::Proxy \"http://$MSRV:3142\";" > /etc/apt/apt.conf.d/00Proxy
|
||||
echo "Acquire::https::Proxy \"http://$MSRV:3142\";" >> /etc/apt/apt.conf.d/00Proxy
|
||||
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
set_node_type() {
|
||||
|
||||
# Determine the node type based on whiplash choice
|
||||
@@ -621,6 +605,22 @@ set_node_type() {
|
||||
|
||||
}
|
||||
|
||||
set_updates() {
|
||||
|
||||
if [ $MASTERUPDATES == 'MASTER' ]; then
|
||||
if [ $OS == 'centos' ]; then
|
||||
echo "proxy=http://$MSRV:3142" >> /etc/yum.conf
|
||||
|
||||
else
|
||||
|
||||
# Set it up so the updates roll through the master
|
||||
echo "Acquire::http::Proxy \"http://$MSRV:3142\";" > /etc/apt/apt.conf.d/00Proxy
|
||||
echo "Acquire::https::Proxy \"http://$MSRV:3142\";" >> /etc/apt/apt.conf.d/00Proxy
|
||||
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
update_sudoers() {
|
||||
|
||||
# Update Sudoers so that socore can accept keys without a password
|
||||
|
||||
Reference in New Issue
Block a user