From cb8a05fa745e7069795597bb6f4c350a355eb7ed Mon Sep 17 00:00:00 2001 From: Charles Wyble Date: Sun, 24 Feb 2019 21:07:14 -0600 Subject: [PATCH] making the dream work --- slack/prod/tsys-base/scripts/postinstall | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/slack/prod/tsys-base/scripts/postinstall b/slack/prod/tsys-base/scripts/postinstall index 0d7f242..f2edff0 100755 --- a/slack/prod/tsys-base/scripts/postinstall +++ b/slack/prod/tsys-base/scripts/postinstall @@ -7,11 +7,23 @@ if [ $ISUCS -ne 0 ]; then exit 1 fi +MGMT_INT=$(netstat -rn|grep 0.0.0.0|head -n1|awk '{print $NF}') +PFV_MGMT_IP=$(ifconfig $MGMT_INT|grep inet|grep 10.251 -c) +OVH_MGMT_IP=$(ifconfig $MGMT_INT|grep inet|grep 10.253 -c) + +if [ $PFV_MGMT_IP -eq 1 ]; then + tsysSysLocation=pfv +fi + +if [ $OVH_MGMT_IP -eq 1 ]; then + tsysSysLocation=ovh +fi + apt-get update apt-get -y --purge autoremove apt-get -y autoclean apt-get -y upgrade apt-get -y dist-upgrade -apt -y install htop glances dstat ladvd snmpd ntp tcpdump autofs logwatch molly-guard +apt -y install htop glances dstat ladvd snmpd ntp tcpdump autofs logwatch molly-guard etckeeper auditd rkhunter rsyslog -slack tsys-base-$tsysSysLocation +slack tsys-$tsysSysLocation