mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 18:22:47 +01:00
[refactor] grep file instead of piping cat to grep
This commit is contained in:
@@ -314,6 +314,7 @@ collect_webuser_inputs() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_minion() {
|
configure_minion() {
|
||||||
|
|
||||||
# You have to pass the TYPE to this function so it knows if its a master or not
|
# You have to pass the TYPE to this function so it knows if its a master or not
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ export PATH=$PATH:../salt/common/tools/sbin
|
|||||||
|
|
||||||
# Global Variables
|
# Global Variables
|
||||||
HOSTNAME=$(cat /etc/hostname)
|
HOSTNAME=$(cat /etc/hostname)
|
||||||
TOTAL_MEM=`grep MemTotal /proc/meminfo | awk '{print $2}' | sed -r 's/.{3}$//'`
|
TOTAL_MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}' | sed -r 's/.{3}$//')
|
||||||
NICS=$(ip link | awk -F: '$0 !~ "lo|vir|veth|br|docker|wl|^[^0-9]"{print $2 " \"" "Interface" "\"" " OFF"}')
|
NICS=$(ip link | awk -F: '$0 !~ "lo|vir|veth|br|docker|wl|^[^0-9]"{print $2 " \"" "Interface" "\"" " OFF"}')
|
||||||
CPUCORES=$(cat /proc/cpuinfo | grep processor | wc -l)
|
CPUCORES=$(grep -c "processor" /proc/cpuinfo)
|
||||||
LISTCORES=$(cat /proc/cpuinfo | grep processor | awk '{print $3 " \"" "core" "\""}')
|
LISTCORES=$(grep "processor" /proc/cpuinfo | awk '{print $3 " \"" "core" "\""}')
|
||||||
RANDOMUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
RANDOMUID=$(</dev/urandom tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||||
NODE_ES_PORT="9200"
|
NODE_ES_PORT="9200"
|
||||||
SETUPLOG="/root/sosetup.log"
|
SETUPLOG="/root/sosetup.log"
|
||||||
# End Global Variables
|
# End Global Variables
|
||||||
|
|||||||
Reference in New Issue
Block a user