From 615e9595cfff7ec73c88ea06637227e0ea3a3b00 Mon Sep 17 00:00:00 2001 From: cedricAbonnel Date: Fri, 5 Jul 2024 22:45:11 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9cup=C3=A9rer=20le=20nom=20de=20l'OS=20da?= =?UTF-8?q?ns=20updateall.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/files_local-bin | 3 ++- local/bin/updateall.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.config/files_local-bin b/.config/files_local-bin index cb08b22..0d203f4 100644 --- a/.config/files_local-bin +++ b/.config/files_local-bin @@ -1,4 +1,5 @@ -updateall +updateall.sh +update_bullseye2buster.sh check_sha256.sh generate_playlist.sh generate_playlist_fp.php diff --git a/local/bin/updateall.sh b/local/bin/updateall.sh index c9eb1a8..a094565 100755 --- a/local/bin/updateall.sh +++ b/local/bin/updateall.sh @@ -83,9 +83,20 @@ create_installkey() { } +# Fonction pour récupérer la valeur de /etc/os-release +get_os_release() { + ssh "$1" 'grep "^PRETTY_NAME=" /etc/os-release' | cut -d'=' -f2 | tr -d \" +} + + update_machine () { local machine="$1" echo -n " - Détection du gestionnaire de mise à jour ... " + + # recupérer le nom de l'OS + os_name=$(get_os_release "$machine") + echo -n " - Système d'exploitation : ${GREEN}$os_name${NC}" + if timeout 5 ssh "$machine" which apt > /dev/null 2>&1; then echo -e "${GREEN}apt${NC}" update_with_apt "$machine"