Skip to content

Commit 3b9834e

Browse files
authored
Merge pull request #6 from OverStyleFR/fix/script-new-interactive-mode
Rewriting of menu.sh script.
2 parents 9355cd2 + 6bc8f66 commit 3b9834e

File tree

3 files changed

+479
-117
lines changed

3 files changed

+479
-117
lines changed

.assets/new.sh

Lines changed: 357 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,370 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
# ==============================================================================
3+
# new.sh — bootstrap multi-distros (console propre + logs détaillés + récap par catégories)
4+
#
5+
# USAGE:
6+
# sudo ./new.sh [OPTIONS]
7+
#
8+
# OPTIONS:
9+
# --debug Active le mode debug (bash -x) et les messages [DEBUG]
10+
# --dry-run N'exécute pas les commandes (simule) — tout est loggué, console propre
11+
# --quiet|-q Réduit la verbosité console (n'affiche que WARN/ERROR, le log reste complet)
12+
#
13+
# COMPORTEMENT:
14+
# - Détecte la distribution / gestionnaire de paquets
15+
# - MAJ index + upgrade système
16+
# - Installe des paquets communs + groupes spécifiques (gnupg, lm-sensors…)
17+
# - fastfetch via dépôts si dispo, sinon script externe
18+
# - Remplace ~/.bashrc (sans rechargement)
19+
# - Timezone Europe/Paris
20+
# - Active avahi-daemon si présent
21+
# - Console : statut d’étapes uniquement ; Logs : détails complets et lisibles (/var/log)
22+
=============================================================================
223

3-
########################################## INITIALISATION ROOT ##########################################
24+
set -euo pipefail
25+
export LANG="${LANG:-C.UTF-8}"
26+
export LC_ALL="${LC_ALL:-C.UTF-8}"
427

5-
# Vérifier si l'utilisateur est root
28+
# ============================== CLI Flags ======================================
29+
DEBUG=0; DRYRUN=0; QUIET=0
30+
for arg in "$@"; do
31+
case "${arg:-}" in
32+
--debug) DEBUG=1 ;;
33+
--dry-run|--dryrun) DRYRUN=1 ;;
34+
--quiet|-q) QUIET=1 ;;
35+
*) ;;
36+
esac
37+
done
38+
[[ $DEBUG -eq 1 ]] && set -x
39+
40+
# ============================== Log setup ======================================
41+
_start_ts=$(date +%s)
42+
LOG_TS="$(date +%Y%m%d-%H%M%S)"
43+
LOG_DIR="/var/log"
44+
LOG_FILE="${LOG_DIR}/new-basics-${LOG_TS}.log"
45+
mkdir -p "$LOG_DIR"; : > "$LOG_FILE"
46+
47+
BOLD="\e[1m"; DIM="\e[2m"; RED="\e[31m"; YEL="\e[33m"; GRN="\e[32m"; BLU="\e[34m"; C0="\e[0m"
48+
_now() { date "+%Y-%m-%d %H:%M:%S%z"; }
49+
_since() { local s=$1; printf "%ds" $(( $(date +%s) - s )); }
50+
_strip() { sed -E 's/\r//g; s/\x1B\[[0-9;]*[A-Za-z]//g'; }
51+
52+
_logfile() { printf "%s\n" "$*" | _strip >> "$LOG_FILE"; }
53+
log() { [[ $QUIET -eq 0 ]] && printf "%b[%s] [INFO ]%b %s\n" "$GRN" "$(_now)" "$C0" "$*"; _logfile "[$(_now)] [INFO ] $*"; }
54+
warn() { printf "%b[%s] [WARN ]%b %s\n" "$YEL" "$(_now)" "$C0" "$*"; _logfile "[$(_now)] [WARN ] $*"; }
55+
err() { printf "%b[%s] [ERROR]%b %s\n" "$RED" "$(_now)" "$C0" "$*"; _logfile "[$(_now)] [ERROR] $*"; }
56+
debug() { [[ $DEBUG -eq 1 ]] && { printf "%b[%s] [DEBUG]%b %s\n" "$BLU" "$(_now)" "$C0" "$*"; _logfile "[$(_now)] [DEBUG] $*"; } || true; }
57+
58+
# ============================== Steps reporting ================================
59+
declare -a REPORT_OK=() REPORT_FAIL=() REPORT_SKIP=()
60+
61+
_step_log_block() {
62+
# $1 desc, $2 status, $3 dur_secs, $4 cmd, $5 tmpfile (stdout+stderr)
63+
{
64+
echo
65+
echo "============================== STEP ================================="
66+
echo "Time : $(_now)"
67+
echo "Step : $1"
68+
echo "Status : $2"
69+
echo "Duration : ${3}s"
70+
echo "Command : $4"
71+
echo "------------------------------ OUTPUT -------------------------------"
72+
[[ -f "$5" ]] && _strip < "$5" || echo "(no output)"
73+
echo "=========================== END OF STEP ============================="
74+
} >> "$LOG_FILE"
75+
}
76+
77+
run() {
78+
local desc="$1"; shift
79+
local ts=$(date +%s)
80+
local cmd_str="$*"
81+
local tmp_out; tmp_out="$(mktemp)"
82+
if [[ $DRYRUN -eq 1 ]]; then
83+
printf "%b[%s] [EXEC ]%b %s\n" "$BOLD" "$(_now)" "$C0" "$desc"
84+
log "OK: (dry-run) $desc"
85+
REPORT_SKIP+=("$desc")
86+
_step_log_block "$desc" "SKIPPED (dry-run)" "0" "$cmd_str" /dev/null
87+
return 100
88+
fi
89+
printf "%b[%s] [EXEC ]%b %s\n" "$BOLD" "$(_now)" "$C0" "$desc"
90+
if "$@" >"$tmp_out" 2>&1; then
91+
local d=$(_since "$ts"); log "OK: $desc (durée $d)"
92+
REPORT_OK+=("$desc")
93+
_step_log_block "$desc" "OK" "${d%s}" "$cmd_str" "$tmp_out"
94+
rm -f "$tmp_out"; return 0
95+
else
96+
local rc=$?; local d=$(_since "$ts")
97+
err "ECHEC: $desc (durée $d, rc=$rc)"
98+
REPORT_FAIL+=("$desc (rc=$rc)")
99+
_step_log_block "$desc" "FAIL (rc=$rc)" "${d%s}" "$cmd_str" "$tmp_out"
100+
rm -f "$tmp_out"; return $rc
101+
fi
102+
}
103+
104+
# --- Wrappers sûrs (ne quittent pas sous set -e) ---
105+
safe_run() { set +e; run "$@"; local rc=$?; set -e; return $rc; }
106+
safe_call() { set +e; "$@"; local rc=$?; set -e; return $rc; }
107+
108+
# ============================== Catégories =====================================
109+
# 0=UNKNOWN, 1=OK, 2=SKIP, 3=FAIL
110+
declare -A CAT
111+
_set_cat() {
112+
local k v cur
113+
k="$1"; v="${2:-0}"
114+
cur="${CAT[$k]:-0}"
115+
[[ "$v" -gt "$cur" ]] && CAT["$k"]="$v" || true
116+
}
117+
print_cat_line() {
118+
local label="$1" code="${2:-0}" val="-"
119+
case "$code" in
120+
1) val="${GRN}✓ OK${C0}" ;;
121+
2) val="${YEL}⏭ SKIP${C0}" ;;
122+
3) val="${RED}✗ FAIL${C0}" ;;
123+
esac
124+
printf " %-28s : %b\n" "$label" "$val"
125+
}
126+
127+
# ============================== Root & contexte ================================
6128
if [[ $EUID -ne 0 ]]; then
7-
echo "Ce script doit être exécuté en tant que root"
8-
# Demander le mot de passe
9-
sudo "$0" "$@"
10-
exit 1
129+
warn "Ce script doit ÃÃêtre exÃÃécutÃÃé en root. Tentative avec sudoÃâÃæ"
130+
exec sudo -E "$0" "$@"
131+
fi
132+
trap 'err "Interruption ou erreur (code=$?) — voir '"$LOG_FILE"'"; exit 1' INT TERM
133+
134+
log "Journal complet: $LOG_FILE"
135+
log "HÃÃôte: $(hostname) | Kernel: $(uname -r) | Arch: $(uname -m)"
136+
log "Shell: $SHELL | DEBUG=$DEBUG | DRYRUN=$DRYRUN | QUIET=$QUIET"
137+
138+
# ============================== DÃÃétection distro ===============================
139+
DIST_ID=""; DIST_LIKE=""
140+
if [[ -r /etc/os-release ]]; then
141+
# shellcheck disable=SC1091
142+
. /etc/os-release
143+
DIST_ID="${ID:-unknown}"; DIST_LIKE="${ID_LIKE:-}"
144+
else
145+
err "/etc/os-release introuvable — abandon."; exit 1
11146
fi
147+
log "Distribution dÃÃétectÃÃée: ID=${DIST_ID} | ID_LIKE=${DIST_LIKE}"
12148

13-
# Le reste du script ici
149+
# ============================== Gestionnaire paquets ===========================
150+
PKG_MGR="" PKG_UPDATE="" PKG_UPGRADE="" PKG_INSTALL=""
151+
case "$DIST_ID" in
152+
debian|ubuntu|linuxmint|pop|kali)
153+
export DEBIAN_FRONTEND=noninteractive
154+
PKG_MGR="apt"
155+
PKG_UPDATE="apt-get update -y"
156+
PKG_UPGRADE="apt-get -y full-upgrade --autoremove --purge"
157+
PKG_INSTALL="apt-get install -y --no-install-recommends -o Dpkg::Use-Pty=0"
158+
;;
159+
fedora)
160+
PKG_MGR="dnf"; PKG_UPDATE="dnf -y makecache"; PKG_UPGRADE="dnf -y upgrade --refresh"; PKG_INSTALL="dnf -y install" ;;
161+
rhel|centos|rocky|almalinux)
162+
if command -v dnf >/dev/null 2>&1; then
163+
PKG_MGR="dnf"; PKG_UPDATE="dnf -y makecache"; PKG_UPGRADE="dnf -y upgrade --refresh"; PKG_INSTALL="dnf -y install"
164+
else
165+
PKG_MGR="yum"; PKG_UPDATE="yum -y makecache"; PKG_UPGRADE="yum -y update"; PKG_INSTALL="yum -y install"
166+
fi ;;
167+
arch|artix|manjaro)
168+
PKG_MGR="pacman"; PKG_UPDATE="pacman -Sy --noconfirm"; PKG_UPGRADE="pacman -Syu --noconfirm"; PKG_INSTALL="pacman -S --noconfirm --needed" ;;
169+
opensuse*|sles)
170+
PKG_MGR="zypper"; PKG_UPDATE="zypper --non-interactive refresh"; PKG_UPGRADE="zypper --non-interactive update"; PKG_INSTALL="zypper --non-interactive install --no-confirm" ;;
171+
alpine)
172+
PKG_MGR="apk"; PKG_UPDATE="apk update"; PKG_UPGRADE="apk upgrade"; PKG_INSTALL="apk add --no-cache" ;;
173+
*)
174+
case "$DIST_LIKE" in
175+
*debian*) DIST_ID="debian"; export DEBIAN_FRONTEND=noninteractive
176+
PKG_MGR="apt"; PKG_UPDATE="apt-get update -y"; PKG_UPGRADE="apt-get -y full-upgrade --autoremove --purge"; PKG_INSTALL="apt-get install -y --no-install-recommends -o Dpkg::Use-Pty=0" ;;
177+
*rhel*|*fedora*)
178+
if command -v dnf >/dev/null 2>&1; then
179+
PKG_MGR="dnf"; PKG_UPDATE="dnf -y makecache"; PKG_UPGRADE="dnf -y upgrade --refresh"; PKG_INSTALL="dnf -y install"
180+
else
181+
PKG_MGR="yum"; PKG_UPDATE="yum -y makecache"; PKG_UPGRADE="yum -y update"; PKG_INSTALL="yum -y install"
182+
fi ;;
183+
*) err "Distribution non gérée (ID=$DIST_ID ID_LIKE=$DIST_LIKE)"; exit 1 ;;
184+
esac
185+
;;
186+
esac
187+
log "Gestionnaire de paquets: $PKG_MGR"; _set_cat "detect_pm" 1
14188

15-
#################################################### FIN ####################################################
189+
# ============================== Helpers paquets ================================
190+
pkg_available() {
191+
local pkg="$1"
192+
case "$PKG_MGR" in
193+
apt) local cand; cand="$(apt-cache policy "$pkg" 2>/dev/null | awk '/Candidate:/ {print $2}')"; [[ -n "${cand:-}" && "${cand:-}" != "(none)" ]] ;;
194+
dnf|yum) $PKG_MGR -q info "$pkg" >/dev/null 2>&1 ;;
195+
pacman) pacman -Si "$pkg" >/dev/null 2>&1 ;;
196+
zypper) zypper info "$pkg" >/dev/null 2>&1 ;;
197+
apk) apk info -e "$pkg" >/dev/null 2>&1 || apk search -x "$pkg" >/dev/null 2>&1 ;;
198+
*) return 1 ;;
199+
esac
200+
}
16201

17-
apt update -y && apt full-upgrade --autoremove --purge -y
202+
install_if_exists() {
203+
local group="$1"; shift
204+
local wanted=("$@")
205+
local ok=() skip=()
206+
for p in "${wanted[@]}"; do
207+
if pkg_available "$p"; then ok+=("$p"); else skip+=("$p"); fi
208+
done
209+
if ((${#ok[@]})); then
210+
if [[ $DRYRUN -eq 0 ]]; then
211+
# shellcheck disable=SC2086
212+
run "Installer ($group)" $PKG_INSTALL ${ok[*]}; return $?
213+
else
214+
run "Installer ($group) — dry-run" echo "$PKG_INSTALL ${ok[*]}" >/dev/null; return 100
215+
fi
216+
else
217+
warn "Aucun paquet installable pour le lot: $group"; return 100
218+
fi
219+
}
18220

19-
apt install gnupg{,2} lm-sensors curl wget htop nload screen vim git ncdu bpytop rsync man avahi-daemon tree dnsutils net-tools ripgrep -y
221+
# ============================== MAJ système ===================================
222+
safe_run "MAJ index paquets" bash -lc "$PKG_UPDATE"; rc=$?
223+
case "$rc" in 0) _set_cat "update_index" 1 ;; 100) _set_cat "update_index" 2 ;; *) _set_cat "update_index" 3 ;; esac
20224

21-
# Installation de 'fastfetch' (remplacement de 'neofetch')
22-
echo "Installation du paquet FastFetch"
23-
bash <(curl -s https://raw.githubusercontent.com/OverStyleFR/AutoScriptBash/main/.assets/fastfetch-install.sh)
225+
safe_run "Upgrade système" bash -lc "$PKG_UPGRADE"; rc=$?
226+
case "$rc" in 0) _set_cat "upgrade_system" 1 ;; 100) _set_cat "upgrade_system" 2 ;; *) _set_cat "upgrade_system" 3 ;; esac
24227

25-
# Mettre l'heure de Europe/Paris
26-
sudo timedatectl set-timezone Europe/Paris
228+
# ============================== Mapping paquets ===============================
229+
PKG_GNUPG=(gnupg gnupg2)
230+
PKG_LMSENS_DEB_RPM=(lm-sensors)
231+
PKG_LMSENS_ARCH=(lm_sensors)
232+
PKG_COMMON=(curl wget htop nload screen vim git ncdu rsync tree net-tools ripgrep)
233+
PKG_MAN_DEB=(man-db manpages)
234+
PKG_MAN_RPM=(man-db man-pages)
235+
PKG_MAN_ARCH=(man-db man-pages)
236+
PKG_DNS_DEB=(dnsutils)
237+
PKG_DNS_RPM=(bind-utils)
238+
PKG_DNS_ARCH=(bind)
239+
PKG_DNS_ALP=(bind-tools)
240+
PKG_AVAHI_DEB=(avahi-daemon)
241+
PKG_AVAHI_OTH=(avahi avahi-daemon)
242+
PKG_BPY=(bpytop)
243+
PKG_BTOP=(btop bashtop)
27244

28-
# Initialisation IP #
29-
(crontab -l ; echo "@reboot /bin/ping -c 5 1.1") | crontab -
245+
log "Sélection des paquets selon famille: $DIST_ID ($PKG_MGR)"
246+
case "$PKG_MGR" in
247+
apt) safe_call install_if_exists "commun" "${PKG_COMMON[@]}" "${PKG_MAN_DEB[@]}" "${PKG_DNS_DEB[@]}" "${PKG_AVAHI_DEB[@]}"; rc=$? ;;
248+
dnf|yum)safe_call install_if_exists "commun" "${PKG_COMMON[@]}" "${PKG_MAN_RPM[@]}" "${PKG_DNS_RPM[@]}" "${PKG_AVAHI_OTH[@]}"; rc=$? ;;
249+
pacman) safe_call install_if_exists "commun" "${PKG_COMMON[@]}" "${PKG_MAN_ARCH[@]}" "${PKG_DNS_ARCH[@]}" "${PKG_AVAHI_OTH[@]}"; rc=$? ;;
250+
zypper) safe_call install_if_exists "commun" "${PKG_COMMON[@]}" "${PKG_MAN_RPM[@]}" "${PKG_DNS_RPM[@]}" "${PKG_AVAHI_OTH[@]}"; rc=$? ;;
251+
apk) safe_call install_if_exists "commun" "${PKG_COMMON[@]}" "${PKG_MAN_RPM[@]}" "${PKG_DNS_ALP[@]}" "${PKG_AVAHI_OTH[@]}"; rc=$? ;;
252+
esac
253+
case "$rc" in 0) _set_cat "install_common" 1 ;; 100) _set_cat "install_common" 2 ;; *) _set_cat "install_common" 3 ;; esac
30254

31-
cd
32-
rm .bashrc
33-
curl -O https://raw.githubusercontent.com/OverStyleFR/AutoScriptBash/main/.assets/.bashrc
34-
source .bashrc
255+
# Spécifiques (best effort)
256+
if [[ "$PKG_MGR" == "pacman" ]]; then
257+
safe_call install_if_exists "lm-sensors" "${PKG_LMSENS_ARCH[@]}" >/dev/null 2>&1 || true
258+
else
259+
safe_call install_if_exists "lm-sensors" "${PKG_LMSENS_DEB_RPM[@]}" >/dev/null 2>&1 || true
260+
fi
261+
safe_call install_if_exists "gnupg" "${PKG_GNUPG[@]}" >/dev/null 2>&1 || true
262+
if pkg_available "${PKG_BPY[0]}"; then
263+
safe_call install_if_exists "monitoring" "${PKG_BPY[@]}" >/dev/null 2>&1 || true
264+
else
265+
safe_call install_if_exists "monitoring" "${PKG_BTOP[@]}" >/dev/null 2>&1 || true
266+
fi
267+
268+
# ============================== Fastfetch ======================================
269+
FASTFETCH_URL="https://raw.githubusercontent.com/OverStyleFR/AutoScriptBash/main/.assets/fastfetch-install.sh"
270+
install_fastfetch() {
271+
if pkg_available fastfetch; then
272+
run "Installer (fastfetch via dépôts)" $PKG_INSTALL fastfetch; return $?
273+
fi
274+
warn "fastfetch non dispo dans les dépôts — fallback script externe"
275+
if [[ $DRYRUN -eq 1 ]]; then
276+
run "Installer (fastfetch via script) — dry-run" echo "bash <(curl -fsSL $FASTFETCH_URL)" >/dev/null; return 100
277+
fi
278+
if command -v curl >/dev/null 2>&1; then
279+
run "Installer (fastfetch via script)" bash -lc "bash <(curl -fsSL \"$FASTFETCH_URL\")"; return $?
280+
elif command -v wget >/dev/null 2>&1; then
281+
run "Installer (fastfetch via script)" bash -lc "bash <(wget -qO- \"$FASTFETCH_URL\")"; return $?
282+
else
283+
err "Ni curl ni wget disponibles — fastfetch non installé."; return 1
284+
fi
285+
}
286+
safe_call install_fastfetch; rc=$?
287+
case "$rc" in 0) _set_cat "fastfetch" 1 ;; 100) _set_cat "fastfetch" 2 ;; *) _set_cat "fastfetch" 3 ;; esac
288+
289+
# ============================== Timezone ======================================
290+
if command -v timedatectl >/dev/null 2>&1; then
291+
safe_run "Réglage timezone Europe/Paris" timedatectl set-timezone Europe/Paris; rc=$?
292+
else
293+
warn "timedatectl indisponible — tentative via /etc/localtime"
294+
ZF="/usr/share/zoneinfo/Europe/Paris"
295+
if [[ -f "$ZF" ]]; then
296+
safe_run "Lien /etc/localtime → Europe/Paris" ln -sf "$ZF" /etc/localtime; rc=$?
297+
[[ -w /etc/timezone ]] && echo "Europe/Paris" >/etc/timezone || true
298+
else
299+
rc=1; err "Zoneinfo non trouvée"
300+
fi
301+
fi
302+
case "$rc" in 0) _set_cat "timezone" 1 ;; 100) _set_cat "timezone" 2 ;; *) _set_cat "timezone" 3 ;; esac
303+
304+
# ============================== .bashrc (sans reload) ==========================
305+
BRC_URL="https://raw.githubusercontent.com/OverStyleFR/AutoScriptBash/main/.assets/.bashrc"
306+
TARGET_USER="${SUDO_USER:-root}"
307+
TARGET_HOME="$(eval echo "~$TARGET_USER")"
308+
TARGET_RC="$TARGET_HOME/.bashrc"
309+
BK="$TARGET_HOME/.bashrc.bak.$(date +%Y%m%d-%H%M%S)"
310+
311+
BRC_RC=0
312+
log "Remplacement du .bashrc pour $TARGET_USER ($TARGET_HOME)"
313+
[[ -f "$TARGET_RC" ]] && { safe_run "Backup $TARGET_RC" cp -a "$TARGET_RC" "$BK" || BRC_RC=1; } || true
314+
if command -v curl >/dev/null 2>&1; then
315+
safe_run "Télécharger .bashrc" curl -fsSL "$BRC_URL" -o "$TARGET_RC" || BRC_RC=1
316+
elif command -v wget >/dev/null 2>&1; then
317+
safe_run "Télécharger .bashrc" wget -q "$BRC_URL" -O "$TARGET_RC" || BRC_RC=1
318+
else
319+
warn "Ni curl ni wget pour récupérer le .bashrc"; BRC_RC=1
320+
fi
321+
[[ -f "$TARGET_RC" ]] && safe_run "Chown .bashrc" chown "$TARGET_USER":"$TARGET_USER" "$TARGET_RC" || true
322+
if [[ -d /etc/skel && -f "$TARGET_RC" ]]; then
323+
safe_run "Copie .bashrc vers /etc/skel" cp -f "$TARGET_RC" /etc/skel/.bashrc || BRC_RC=1
324+
fi
325+
if [[ "$BRC_RC" -eq 0 ]]; then _set_cat "bashrc" 1; else _set_cat "bashrc" 3; fi
326+
327+
# ============================== Avahi (enable si présent) =====================
328+
if command -v systemctl >/dev/null 2>&1; then
329+
if systemctl list-unit-files | grep -q '^avahi-daemon\.service'; then
330+
safe_run "Activer avahi-daemon" systemctl enable --now avahi-daemon; rc=$?
331+
case "$rc" in 0) _set_cat "avahi" 1 ;; 100) _set_cat "avahi" 2 ;; *) _set_cat "avahi" 3 ;; esac
332+
else
333+
debug "Service avahi-daemon non présent — ignoré."; _set_cat "avahi" 2
334+
fi
335+
else
336+
debug "systemctl indisponible — probablement sans systemd."; _set_cat "avahi" 2
337+
fi
338+
339+
# ============================== Récapitulatif (catégories) =====================
340+
echo
341+
printf "%b============================= RÉCAPITULATIF =============================%b\n" "$BOLD" "$C0"
342+
echo " Journal : $LOG_FILE"
343+
echo " Distro : ID=$DIST_ID | LIKE=$DIST_LIKE | PM=$PKG_MGR"
344+
echo " Durée : $(_since "$_start_ts")"
345+
echo
346+
echo -e "${BOLD}Catégories:${C0}"
347+
print_cat_line "Détection gestionnaire" "${CAT[detect_pm]:-0}"
348+
print_cat_line "MAJ index paquets" "${CAT[update_index]:-0}"
349+
print_cat_line "Upgrade système" "${CAT[upgrade_system]:-0}"
350+
print_cat_line "Paquets communs" "${CAT[install_common]:-0}"
351+
print_cat_line "Fastfetch" "${CAT[fastfetch]:-0}"
352+
print_cat_line "Timezone (Europe/Paris)" "${CAT[timezone]:-0}"
353+
print_cat_line ".bashrc (déploiement)" "${CAT[bashrc]:-0}"
354+
print_cat_line "Avahi (enable si présent)" "${CAT[avahi]:-0}"
355+
echo
356+
echo -e "${BOLD}Détail étapes:${C0}"
357+
echo " Étapes OK : ${#REPORT_OK[@]}"
358+
for s in "${REPORT_OK[@]}"; do printf " %b✓%b %s\n" "$GRN" "$C0" "$s"; done
359+
echo
360+
echo " Étapes FAIL : ${#REPORT_FAIL[@]}"
361+
for s in "${REPORT_FAIL[@]}"; do printf " %b✗%b %s\n" "$RED" "$C0" "$s"; done
362+
if [[ $DRYRUN -eq 1 || ${#REPORT_SKIP[@]} -gt 0 ]]; then
363+
echo
364+
echo " Étapes SKIP : ${#REPORT_SKIP[@]}"
365+
for s in "${REPORT_SKIP[@]}"; do printf " %b⏭%b %s\n" "$YEL" "$C0" "$s"; done
366+
fi
367+
printf "%b=========================================================================%b\n" "$BOLD" "$C0"
35368

369+
log "Configuration terminée."
370+
# Fin

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sh text eol=lf

0 commit comments

Comments
 (0)