diff --git a/lib/aaa_errors.sh b/lib/aaa_errors.sh index fa1fa9e..3909ed1 100644 --- a/lib/aaa_errors.sh +++ b/lib/aaa_errors.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Error management functions +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/lib/display.sh b/lib/display.sh index d205f77..e3f5007 100644 --- a/lib/display.sh +++ b/lib/display.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Some display functions and defines color codes +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/lib/pkgman.sh b/lib/pkgman.sh index 356b63c..f462f0d 100644 --- a/lib/pkgman.sh +++ b/lib/pkgman.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Package manager integration +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/lib/services.sh b/lib/services.sh index 513f800..2450f41 100644 --- a/lib/services.sh +++ b/lib/services.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Services manipulation functions +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/lib/support.sh b/lib/support.sh index f3ad63c..8e91033 100644 --- a/lib/support.sh +++ b/lib/support.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Base support function +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/lib/zzz_main_fct.sh b/lib/zzz_main_fct.sh index 801a324..56e45e2 100644 --- a/lib/zzz_main_fct.sh +++ b/lib/zzz_main_fct.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ -# Base functions +# Main program functions +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/authnz.sh b/modules/authnz.sh index ac7d369..22910ec 100644 --- a/modules/authnz.sh +++ b/modules/authnz.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Add local or remote users +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -44,11 +45,11 @@ authnz() /etc/pam.d scv_restart nscd - fi - for usr in $REMOTE_USERS; do - add_remote_user $usr - done + for usr in $REMOTE_USERS; do + add_remote_user $usr + done + fi for usr in $LOCAL_USERS; do prnt I "Création de l'utilisateur $usr..." @@ -68,10 +69,11 @@ precheck_authnz() else if [[ -n $REMOTE_USERS ]]; then prnt E "Impossible d'ajouter des utilisateurs distants sans les méchanismes d'authentication." + die 109 fi fi if [[ -n $LOCAL_USERS ]]; then prnt I "Les utilisateurs locaux suivants seront créés :" - prnt m "\t$LOCAL_USERS" + prnt m "\t* $LOCAL_USERS" fi } diff --git a/modules/conf_disks.sh b/modules/conf_disks.sh index 0c7ad91..f99068d 100644 --- a/modules/conf_disks.sh +++ b/modules/conf_disks.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Secondary drive configuration +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/conf_mail.sh b/modules/conf_mail.sh index 2d1000e..2edb150 100644 --- a/modules/conf_mail.sh +++ b/modules/conf_mail.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Mail system +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -20,7 +21,8 @@ conf_mail() prnt I "Configuration de postfix..." installfile postfix_main.cf /etc/postfix/main.cf - sed -i -e "s/@HOSTNAME@/$HOSTNAME/g" /etc/postfix/main.cf + sed -i -e "s/@HOSTNAME@/$HOSTNAME/" -e "s/@MAINDOM@/$MAINDOM/" \ + /etc/postfix/main.cf echo $HOSTNAME.$MAINDOM > /etc/mailname svc_restart postfix } diff --git a/modules/conf_ntp.sh b/modules/conf_ntp.sh index 837b5a4..0619968 100644 --- a/modules/conf_ntp.sh +++ b/modules/conf_ntp.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Configure NTP +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/conf_ssh.sh b/modules/conf_ssh.sh index 727df74..834caa9 100644 --- a/modules/conf_ssh.sh +++ b/modules/conf_ssh.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Configure SSH client and server +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/conf_syslog.sh b/modules/conf_syslog.sh index fc33656..6b0675f 100644 --- a/modules/conf_syslog.sh +++ b/modules/conf_syslog.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Configure Rsyslog +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/create_vm.sh b/modules/create_vm.sh index 679a24f..51ab1b3 100644 --- a/modules/create_vm.sh +++ b/modules/create_vm.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Create VBox VM +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/install_chromium.sh b/modules/install_chromium.sh index 21b73e1..6cd8e53 100644 --- a/modules/install_chromium.sh +++ b/modules/install_chromium.sh @@ -2,6 +2,7 @@ # Since Ubuntu install snapd version of Chromium and we don't want that # we need a special procedure to install Debian Buster version. # Consequently that module is *Ubuntu centric. +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/install_desktop.sh b/modules/install_desktop.sh index 5d18bf1..0be24a4 100644 --- a/modules/install_desktop.sh +++ b/modules/install_desktop.sh @@ -1,6 +1,7 @@ # ------------------------------------------------------------------------------ # Install desktop environment -- Ubuntu only # Debian version might ask for task-$FLAVOR +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/install_mkagent.sh b/modules/install_mkagent.sh index 95efaa8..6d7b84d 100644 --- a/modules/install_mkagent.sh +++ b/modules/install_mkagent.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Install check_mk agent using xinetd superserver +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -24,6 +25,10 @@ install_mkagent() precheck_install_mkagent() { + [[ -n $MKVERSION ]] && ( + prnt E "Undeclared check_mk version of the agent to install." + die 162 + ) [[ -n $MK_SERVER ]] && ( prnt E "Undeclared check_mk server." die 162 diff --git a/modules/install_pkg.sh b/modules/install_pkg.sh index de7317c..c3b0821 100644 --- a/modules/install_pkg.sh +++ b/modules/install_pkg.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Install or remove packages +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. diff --git a/modules/patch_snmp.sh b/modules/patch_snmp.sh index d1d4fbf..e13d24c 100644 --- a/modules/patch_snmp.sh +++ b/modules/patch_snmp.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # SNMP monitoring conf +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -11,8 +12,8 @@ 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 + 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 ]] && diff --git a/modules/upgrade_dist.sh b/modules/upgrade_dist.sh index 718b67b..78772c0 100644 --- a/modules/upgrade_dist.sh +++ b/modules/upgrade_dist.sh @@ -1,6 +1,7 @@ # ------------------------------------------------------------------------------ # Distribution upgrade module, should be ran prior any other module (also # configure APT) +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -21,7 +22,7 @@ upgrade_dist() prnt I "Configuration du proxy pour APT..." if [[ $PROXYAPT ]]; then if [[ ! -d $(basedir $proxyfile) ]]; then - mkdir -pv /etc/apt/apt.conf.d || ( + mkdir -pv $(basedir $proxyfile) || ( prnt E "Impossiblle de créer le répertoire d'accueil pour la configuration d'APT." die 60 ) @@ -35,8 +36,10 @@ upgrade_dist() prnt I "Mise à jour de la liste des paquets..." pkgupdt + prnt I "Application des mises à jour de paquets..." pkgupdg + prnt I "Suppression des paquets résiduels..." pkgautorem } diff --git a/repo/common/postfix_main.cf b/repo/common/postfix_main.cf index 3742318..c28a42a 100644 --- a/repo/common/postfix_main.cf +++ b/repo/common/postfix_main.cf @@ -31,7 +31,7 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # information on enabling SSL in the smtp client. #smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination -myhostname = @HOSTNAME@.geoffray-levasseur.org +myhostname = @HOSTNAME@.@MAINDOM@ alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname