moved old code to modules, cleanup

This commit is contained in:
fatalerrors
2021-06-18 12:02:01 +02:00
parent 8bb69f931d
commit 1a964640d9
8 changed files with 108 additions and 51 deletions

49
init.sh
View File

@@ -65,55 +65,6 @@ else
fi
fi
# Profile
install_profile()
{
installfile ansi_shadow.flf /usr/share/figlet/ansi_shadow.flf
for usr in /root /home/*; do
backupdist $usr/{,.}profile $usr/.bashrc
installfile {{.,}profile,.bashrc} $usr/
done
backupdist /etc/motd
installfile motd /etc/motd
}
# Supervision
patch_snmp()
{
backupdist /etc/snmp/snmpd.conf /etc/default/snmpd /lib/systemd/system/snmpd.service \
/etc/init.d/snmpd
installfile snmpd.conf /etc/snmp/snmpd.conf
installfile snmpd.init /etc/init.d/snmpd
[[ -e /lib/systemd/system/snmpd.service ]] &&
installfile snmpd.service /lib/systemd/system/snmpd.service
/etc/init.d/snmpd restart || true # error on systemd systems requiring reboot wich we'll do anyway after that script
}
install_mk-agent()
{
apt install -y $BASEGPDIR/mk_agents/check-mk-agent_${MKVERSION}_all.deb
backupdist /etc/xinetd.d/check_mk
installfile check_mk /etc/xinetd.d/check_mk
/etc/init.d/xinetd restart
}
# Syslog
conf_syslog()
{
backupdist /etc/rsyslog.conf
installfile rsyslog.conf /etc/rsyslog.conf
/etc/init.d/rsyslog restart
}
# Mail
conf_mail()
{
installfile postfix.cf /etc/postfix/main.cf
sed -i -e "s/#HOSTNAME#/$HOSTNAME/g" /etc/postfix/main.cf
/etc/init.d/postfix restart
}
# ======================
# ==== Main Program ====
# ======================