diff --git a/conf/includes/pkgsel.conf.sh b/conf/includes/pkgsel.conf.sh index 48aa502..6ec0cb6 100644 --- a/conf/includes/pkgsel.conf.sh +++ b/conf/includes/pkgsel.conf.sh @@ -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" diff --git a/init.sh b/init.sh index fa13a06..56390c3 100755 --- a/init.sh +++ b/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 ==== # ====================== diff --git a/modules/conf_mail.sh b/modules/conf_mail.sh new file mode 100644 index 0000000..56dfabb --- /dev/null +++ b/modules/conf_mail.sh @@ -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 diff --git a/modules/conf_syslog.sh b/modules/conf_syslog.sh new file mode 100644 index 0000000..ae8c792 --- /dev/null +++ b/modules/conf_syslog.sh @@ -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 + diff --git a/modules/install_mk-agent.sh b/modules/install_mk-agent.sh new file mode 100644 index 0000000..b7c1772 --- /dev/null +++ b/modules/install_mk-agent.sh @@ -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 diff --git a/modules/install_pkg.sh b/modules/install_pkg.sh index fae596c..5975e04 100644 --- a/modules/install_pkg.sh +++ b/modules/install_pkg.sh @@ -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 diff --git a/modules/install_profile.sh b/modules/install_profile.sh new file mode 100644 index 0000000..bd35514 --- /dev/null +++ b/modules/install_profile.sh @@ -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 diff --git a/modules/patch_snmp.sh b/modules/patch_snmp.sh new file mode 100644 index 0000000..410fa51 --- /dev/null +++ b/modules/patch_snmp.sh @@ -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