From 17e094c22ad50f8bdc6fbc0458abbf3337914ead Mon Sep 17 00:00:00 2001 From: Charles Wyble Date: Sun, 21 Apr 2019 14:29:05 -0500 Subject: [PATCH] odds and ends --- fixHosts.sh | 40 ++++++++++++++++++++++++ slack/prod/tsys-base/scripts/postinstall | 37 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100755 fixHosts.sh diff --git a/fixHosts.sh b/fixHosts.sh new file mode 100755 index 0000000..4dc9640 --- /dev/null +++ b/fixHosts.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +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) + + +####################################################################################################################################################### +#Step 2: Fixup the /etc/hosts file +####################################################################################################################################################### + + + +if [ $PFV_MGMT_IP -eq 1 ]; then +#Static /etc/hosts bits +cat > /etc/hosts << HOSTFILESTATIC +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 +HOSTFILESTATIC + +#Dynamic /etc/hosts bits +cat >> /etc/hosts < /etc/hosts << HOSTFILESTATIC +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 +HOSTFILESTATIC + +#Dynamic /etc/hosts bits +cat >> /etc/hosts < /etc/hosts << HOSTFILESTATIC +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 +HOSTFILESTATIC + +#Dynamic /etc/hosts bits +cat >> /etc/hosts < /etc/hosts << HOSTFILESTATIC +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 +HOSTFILESTATIC + +#Dynamic /etc/hosts bits +cat >> /etc/hosts < /etc/mailname + #Step 3: The usual suspects export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" install snmpd ncdu iftop nethogs screen acct tshark tcpdump glances dstat htop sysdig sysstat rsync clamav logwatch zsh sl postfix molly-guard mailutils ladvd auditd rkhunter rsyslog ngrep ntp nut-client lm-sensors zlib1g-dev uuid-dev libmnl-dev gcc make autoconf autoconf-archive autogen automake pkg-config curl