From 0c3332fd2e0d611da851157fdd37f85bffae01e7 Mon Sep 17 00:00:00 2001
From: Djan GICQUEL <>
Date: Sun, 27 Jun 2021 19:50:09 +0200
Subject: [PATCH] ajout d'un if en cas d'absence de choix pour info et
suppression archivex
---
borg-gui.sh | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/borg-gui.sh b/borg-gui.sh
index 47cc7da..959636e 100755
--- a/borg-gui.sh
+++ b/borg-gui.sh
@@ -151,14 +151,25 @@ elif [ "$choixmenu" = "ss" ];then
# Supprimmer une archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
- borg delete $borg_repo::$borg_archive | zenity --width=600 --progress --pulsate --auto-close
- zenity --width=600 --info --text="Suppresion de l'archive $borg_archive terminée"
+ if [ "$borg_archive" = "" ];then
+ zenity --width=600 --info --text "Aucune archive choisie, retour au menu"
+ else
+ borg delete $borg_repo::$borg_archive | zenity --width=600 --progress --pulsate --auto-close
+ zenity --width=600 --info --text="Suppresion de l'archive $borg_archive terminée"
+ fi
+
elif [ "$choixmenu" = "is" ];then
# Information archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
- zenity --width=600 --info --text="$(borg info $borg_repo::$borg_archive)" | zenity --width=600 --progress --pulsate --auto-close
+ if [ "$borg_archive" = "" ];then
+ zenity --width=600 --info --text "Aucune archive choisie, retour au menu"
+ else
+ borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
+ zenity --width=600 --info --text="$(borg info $borg_repo::$borg_archive)" | zenity --width=600 --progress --pulsate --auto-close
+ fi
+
elif [ "$choixmenu" = "id" ];then
# Information sur le dépôt