filtre dans une fonction BorgFilter

This commit is contained in:
Djan GICQUEL 2021-08-04 20:32:21 +02:00
parent 79e1c4c520
commit a0b56b55f0

View File

@ -64,6 +64,14 @@ ZenityPulsate () {
zenity $W $iconborg --progress --pulsate --auto-close
}
BorgFilter () {
if [ "$filter" = "" ];then
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
else
borg_archive=$(borg list --short $borg_repo| grep $filter | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
fi
}
# Profils et tests
#################################################################################
# si $1 n'est pas vide fichier de profil = $1
@ -139,24 +147,15 @@ qu\nQUITTER\
elif [ "$choixmenu" = "ms" ];then
# Monter une archive
if [ "$filter" = "" ];then
BorgList="borg list --short $borg_repo"
else
BorgList="borg list --short $borg_repo | grep $filter"
BorgFilter
if [ ! "$borg_archive" = "" ];then
mkdir $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive | ZenityPulsate
zenity $W --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
fi
echo $BorgList
#borg_archive=$($BorgList | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
#if [ ! "$borg_archive" = "" ];then
#mkdir $HOME/$borg_archive
#borg mount $borg_repo::$borg_archive $HOME/$borg_archive | ZenityPulsate
#zenity $W --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
#fi
elif [ "$choixmenu" = "dm" ];then
# Demonter une archive
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity $W $H $iconborg --list --title "Liste des points de montages" --column "Archive")
if [ ! "$ptnmontage" = "" ];then
fusermount -u $ptnmontage | ZenityPulsate
@ -166,14 +165,7 @@ qu\nQUITTER\
elif [ "$choixmenu" = "ss" ];then
# Supprimmer une archive
if [ "$filter" = "" ];then
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
else
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
fi
BorgFilter
if [ "$borg_archive" = "" ];then
zenity $W --info --text "Aucune archive choisie, retour au menu"
else
@ -184,13 +176,7 @@ qu\nQUITTER\
elif [ "$choixmenu" = "is" ];then
# Information archive
if [ "$filter" = "" ];then
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
else
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
fi
BorgFilter
if [ "$borg_archive" = "" ];then
zenity $W --info --text "Aucune archive choisie, retour au menu"
else
@ -199,17 +185,14 @@ qu\nQUITTER\
elif [ "$choixmenu" = "fi" ];then
#Filtre
filter=$(zenity --entry)
elif [ "$choixmenu" = "id" ];then
# Information sur le dépôt
zenity $W --info --text="<tt>$(borg info $borg_repo)</tt>" | ZenityPulsate
elif [ "$choixmenu" = "ap" ];then
# Afficher le profil
zenity $W $H --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
fi