moved old code to modules, cleanup
This commit is contained in:
@@ -78,3 +78,7 @@ export PKGS_TEX="auctex texinfo texlive-base texlive-extra-utils \
|
||||
# Outils divers
|
||||
export PKGS_TOOLS="asciidoc docbook-utils doxygen help2man python-sphinx \
|
||||
python3-sphinx tidy ncftp filezilla openjdk-8-jre"
|
||||
|
||||
# Agrégation de tout par défaut
|
||||
export PKGSEL="$PKGS_BASE $PKGS_BUR $PKGS_FONTS $PKGS_GRAF $PKGS_MULTI \
|
||||
$PKGS_SCI $PKGS_PRGM $PKGS_TEX $PKGS_TOOLS"
|
||||
|
||||
49
init.sh
49
init.sh
@@ -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 ====
|
||||
# ======================
|
||||
|
||||
19
modules/conf_mail.sh
Normal file
19
modules/conf_mail.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
# Mail systême
|
||||
|
||||
export VER_conf_mail="0.0.1"
|
||||
|
||||
conf_mail()
|
||||
{
|
||||
prnt I "Configuration de postfix..."
|
||||
installfile postfix.cf /etc/postfix/main.cf
|
||||
sed -i -e "s/#HOSTNAME#/$HOSTNAME/g" /etc/postfix/main.cf
|
||||
svc_restart postfix
|
||||
}
|
||||
|
||||
precheck_conf_mail()
|
||||
{
|
||||
: # Nothing to check
|
||||
}
|
||||
|
||||
export -f conf_mail
|
||||
export -f precheck_conf_mail
|
||||
20
modules/conf_syslog.sh
Normal file
20
modules/conf_syslog.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
# Syslog
|
||||
|
||||
export VER_conf_syslog="0.0.1"
|
||||
|
||||
conf_syslog()
|
||||
{
|
||||
prnt I "Configuration de rsyslog..."
|
||||
backupdist /etc/rsyslog.conf
|
||||
installfile rsyslog.conf /etc/rsyslog.conf
|
||||
svc_restart rsyslog
|
||||
}
|
||||
|
||||
precheck_conf_syslog()
|
||||
{
|
||||
: # Rien à vérifier
|
||||
}
|
||||
|
||||
export -f conf_syslog
|
||||
export -f precheck_conf_syslog
|
||||
|
||||
18
modules/install_mk-agent.sh
Normal file
18
modules/install_mk-agent.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
export VER_install_mkagent="0.0.1"
|
||||
|
||||
install_mkagent()
|
||||
{
|
||||
pkginst $MYPATH/repo/mk_agents/check-mk-agent_${MKVERSION}_all.deb
|
||||
backupdist /etc/xinetd.d/check_mk
|
||||
installfile check_mk /etc/xinetd.d/check_mk
|
||||
svc_restart xinetd
|
||||
}
|
||||
|
||||
precheck_install_mkagent()
|
||||
{
|
||||
: # rien à vérifier
|
||||
}
|
||||
|
||||
export -f install_mkagent
|
||||
export -f precheck_install_mkagent
|
||||
@@ -4,14 +4,14 @@ export VER_install_pkg="0.0.1"
|
||||
|
||||
install_pkg()
|
||||
{
|
||||
[[ $PKGLIST ]] &&
|
||||
[[ $PKGSEL ]] &&
|
||||
prnt I "Installation de la sélection de paquets..." &&
|
||||
pkginst $PKGSEL
|
||||
}
|
||||
|
||||
precheck_install_pkg()
|
||||
{
|
||||
[[ ! $PKGLIST ]] && prnt W "Pas de paquet additionel à installer !"
|
||||
[[ ! $PKGSEL ]] && prnt W "Pas de paquet additionel à installer !"
|
||||
}
|
||||
|
||||
export -f install_pkg
|
||||
|
||||
22
modules/install_profile.sh
Normal file
22
modules/install_profile.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
# Profile
|
||||
|
||||
export VER_install_profile="0.0.1"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
precheck_install_profile()
|
||||
{
|
||||
:
|
||||
}
|
||||
|
||||
export -f install_profile
|
||||
export -f precheck_install_profile
|
||||
23
modules/patch_snmp.sh
Normal file
23
modules/patch_snmp.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
# Supervision
|
||||
|
||||
export VER_patch_snmp="0.0.1"
|
||||
|
||||
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 &&
|
||||
systemctl daemon-reload
|
||||
svc_restart snmpd
|
||||
}
|
||||
|
||||
precheck_patch_snmp()
|
||||
{
|
||||
:
|
||||
}
|
||||
|
||||
export -f patch_snmp
|
||||
export -f precheck_patch_snmp
|
||||
Reference in New Issue
Block a user