diff --git a/setup/so-setup b/setup/so-setup index ced2948f2..51c277172 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -32,16 +32,6 @@ fi # Allow execution of SO tools during setup export PATH=$PATH:../salt/common/tools/sbin -# Global Variables -HOSTNAME=$(cat /etc/hostname) -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"}') -CPUCORES=$(grep -c "processor" /proc/cpuinfo | grep -cv KVM) -LISTCORES=$(grep "processor" /proc/cpuinfo | awk '{print $3 " \"" "core" "\""}') -RANDOMUID=$( $SETUPLOG 2>&1 diff --git a/setup/so-variables b/setup/so-variables new file mode 100644 index 000000000..1044fbf33 --- /dev/null +++ b/setup/so-variables @@ -0,0 +1,36 @@ +#!/bin/bash + +export total_mem +total_mem=$(grep MemTotal /proc/meminfo | awk '{print $2}' | sed -r 's/.{3}$//') + +export hostname +hostname=$(cat /etc/hostname) + +export all_nics +all_nics=$(ip link | awk -F: '$0 !~ "lo|vir|veth|br|docker|wl|^[^0-9]"{print $2 " \"" "Interface" "\"" " OFF"}') + +export cpu_cores +cpu_cores=$(grep -c "processor" /proc/cpuinfo | grep -v "KVM") + +export cpu_core_list +cpu_core_list=$(grep "processor" /proc/cpuinfo | grep -v "KVM" | awk '{print $3 " \"" "core" "\""}') + +export random_uid +random_uid=$(