amélioration du nettoyage temporaire automatique
This commit is contained in:
@@ -151,8 +151,20 @@ run_custom_script() {
|
|||||||
if [ -f "$custom_script" ]; then
|
if [ -f "$custom_script" ]; then
|
||||||
echo -e " - Exécution du script spécifique pour ${GREEN}$machine${NC}"
|
echo -e " - Exécution du script spécifique pour ${GREEN}$machine${NC}"
|
||||||
# Copier le script sur la machine et l'exécuter
|
# Copier le script sur la machine et l'exécuter
|
||||||
scp "$custom_script" "$machine:/tmp/updateall_custom.sh" && \
|
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'
|
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
|
else
|
||||||
echo " - Aucun script spécifique pour $machine."
|
echo " - Aucun script spécifique pour $machine."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user