Intégration du système de filtre

This commit is contained in:
Djan GICQUEL 2021-07-04 20:00:29 +02:00
parent bd2819a6a5
commit b5add4a158
1 changed files with 15 additions and 9 deletions

View File

@ -100,6 +100,8 @@ ms\nMonter une archive\n\
dm\nDemonter une archive\n\
ss\nSupprimmer une archive\n\
is\nInformation archive\n\
fi\nFiltre : "$filter"\n\
--\n------------------------------------------\n\
id\nInformation sur le dépôt\n\
ap\nAfficher le profil\n\
ed\nEspace disque utilisé\n\
@ -125,16 +127,10 @@ if [ "$choixmenu" = "cs" ] ;then
zenity --notification --text "Sauvegarde $nomsauvegarde terminée"
zenity --width=600 --info --text "Sauvegarde $nomsauvegarde terminée"
elif [ "$choixmenu" = "ed" ] ;then
# Espace disque utilisé
espacedisqueutil=$(df -k --output=pcent $borg_repo | tail -n +2)
zenity --width=600 --info --text "Espace disque utilisé : $espacedisqueutil"
elif [ "$choixmenu" = "ms" ];then
# Monter une archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity --height=500 --list --title "Listes des archives" --column "Archive")
mkdir $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive | zenity --width=600 --progress --pulsate --auto-close
zenity --width=600 --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
@ -150,7 +146,7 @@ elif [ "$choixmenu" = "dm" ];then
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_archive=$(borg list --short $borg_repo | grep $filter | zenity --height=500 --list --title "Listes des archives" --column "Archive")
if [ "$borg_archive" = "" ];then
zenity --width=600 --info --text "Aucune archive choisie, retour au menu"
else
@ -162,13 +158,17 @@ elif [ "$choixmenu" = "ss" ];then
elif [ "$choixmenu" = "is" ];then
# Information archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity --height=500 --list --title "Listes des archives" --column "Archive")
if [ "$borg_archive" = "" ];then
zenity --width=600 --info --text "Aucune archive choisie, retour au menu"
else
zenity --width=600 --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>" | zenity --width=600 --progress --pulsate --auto-close
fi
elif [ "$choixmenu" = "fi" ];then
#Filtre
filter=$(zenity --entry)
elif [ "$choixmenu" = "id" ];then
# Information sur le dépôt
@ -180,6 +180,12 @@ elif [ "$choixmenu" = "ap" ];then
zenity --width=600 --height=400 --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
elif [ "$choixmenu" = "ed" ] ;then
# Espace disque utilisé
espacedisqueutil=$(df -k --output=pcent $borg_repo | tail -n +2)
zenity --width=600 --info --text "Espace disque utilisé : $espacedisqueutil"
elif [ "$choixmenu" = "" ];then
zenity --width=600 --info --text="Aucun choix, retour au menu."
fi