diff --git a/test.sh b/test.sh index cb593aa..5365242 100644 --- a/test.sh +++ b/test.sh @@ -15,10 +15,11 @@ echo # Vérification mariadb-backup est installé. -MariaBackupVersion=$(command mariabackup -v 2> /dev/null) +MariaBackupVersion=$(command mariabackup -v 2>&1 | grep -E '[0-9]+\.[0-9]') -if [ -z "$MariaBackupVersionj" ]; then +if [ -z "$MariaBackupVersion" ]; then echo "ERREUR: mariadb-backup non installé" + echo exit 1 fi @@ -31,9 +32,11 @@ MARIADB_VER=$(mariadb --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head # Comparaison des versions if [ "$BACKUP_VER" = "$MARIADB_VER" ]; then echo "OK Versions identiques" + echo exit 0 else echo "Attention versions différentes, veuillez installer la version adapté" + echo exit 0 fi