From 3ae1fa108e95212e75f487eb8593f7419a68d358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= Date: Thu, 29 May 2025 07:18:45 +0200 Subject: [PATCH] =?UTF-8?q?am=C3=A9lioration=20du=20nettoyage=20temporaire?= =?UTF-8?q?=20automatique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- local/bin/updateall.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/local/bin/updateall.sh b/local/bin/updateall.sh index 343ae7d..6ff6f87 100755 --- a/local/bin/updateall.sh +++ b/local/bin/updateall.sh @@ -151,8 +151,20 @@ run_custom_script() { if [ -f "$custom_script" ]; then echo -e " - Exécution du script spécifique pour ${GREEN}$machine${NC}" # Copier le script sur la machine et l'exécuter - scp "$custom_script" "$machine:/tmp/updateall_custom.sh" && \ - ssh -tt "$machine" 'chmod +x /tmp/updateall_custom.sh && sudo /tmp/updateall_custom.sh && sudo rm /tmp/updateall_custom.sh' + scp "$custom_script" "$machine:/tmp/updateall_custom.sh" + if [ $? -eq 0 ]; then + echo " - Script copié, exécution en cours..." + ssh -tt "$machine" ' + chmod +x /tmp/updateall_custom.sh + sudo /tmp/updateall_custom.sh + status=$? + sudo rm -f /tmp/updateall_custom.sh + exit $status + ' + else + echo -e "${RED} - Échec du transfert du script personnalisé${NC}" + fi + else echo " - Aucun script spécifique pour $machine." fi