diff --git a/init.sh b/init.sh index 87faf0f..4b39c9c 100755 --- a/init.sh +++ b/init.sh @@ -2,17 +2,22 @@ # Init : initialise une machine et la met en conformité # Copyright (c) 2021 Geoffray Levasseur -# Remember the running path +export VERSION="0.95.1" + +# Stocke le chemin du script MYPATH=$(dirname $0) -# Load libraries +# Charge les bibliothèques for lib in $MYPATH/lib/*.sh; do . $lib done -# Important global variables +# Variables globales importantes export HOSTNAME=$(hostname) -export LOGFILE=${LOGFILE:-"/root/init-$(uname -n)-$(stdtime).log"} +export LOGFILE=${LOGFILE:-"$MYPATH/log/init-$(uname -n)-$(stdtime).log"} + +prnt I "Création du répertoire d'accueil du fichier log..." +[[ ! -d $(dirname $LOGFILE) ]] && mkdir -pv $(dirname $LOGFILE) # Log toute les sortie dans le fichier de log exec 3>&1 4>&2 @@ -20,6 +25,7 @@ trap 'exec 2>&4 1>&3' 0 1 2 3 exec 1>$LOGFILE 2>&1 # Récupère la configuration +prnt I "Chargement de la configuration..." . $MYPATH/conf/init.conf.sh # Authentication diff --git a/modules/conf_disks.sh b/modules/conf_disks.sh index d7e4b4c..1a3df0d 100644 --- a/modules/conf_disks.sh +++ b/modules/conf_disks.sh @@ -1,6 +1,7 @@ -#!/bin/bash # Configuration du disque de calcul +export VER_conf_disk="0.0.2" + # ------------------------------------------------------------------------------ # Cas de ZFS conf_zfs() diff --git a/modules/conf_locale.sh b/modules/conf_locale.sh index f1bef11..9987128 100644 --- a/modules/conf_locale.sh +++ b/modules/conf_locale.sh @@ -1,5 +1,7 @@ # Locale +export VER_conf_locale="0.0.1" + conf_locale() { backupdist /etc/locale.gen diff --git a/modules/conf_ntp.sh b/modules/conf_ntp.sh index 7eeec8c..8fdfa18 100644 --- a/modules/conf_ntp.sh +++ b/modules/conf_ntp.sh @@ -1,5 +1,7 @@ # NTP +export VER_conf_ntp="0.0.1" + conf_ntp() { prnt I "Installation du fichier de configuration de NTP." diff --git a/modules/upgrade_dist.sh b/modules/upgrade_dist.sh index 8e92320..9975329 100644 --- a/modules/upgrade_dist.sh +++ b/modules/upgrade_dist.sh @@ -1,6 +1,7 @@ -#!/bin/bash # Module mise à jour de la distribution +export VER_upgrade_dist="0.0.2" + upgrade_dist() { local proxyfile=/etc/apt/apt.conf.d/00proxy