Nouvelle version du selecteur de profils

This commit is contained in:
Djan GICQUEL 2021-08-04 18:49:43 +02:00
parent d3681acba6
commit 79e1c4c520
1 changed files with 20 additions and 11 deletions

View File

@ -72,8 +72,13 @@ if [ ! $1 = "" ]; then
fichierprofil="$1"
. "$1"
else
fichierprofil=$(ls -1 "$dossierprofil"*.conf | zenity $H $W $iconborg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil")
. $fichierprofil
cd $dossierprofil
fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \
zenity $W $H $iconborg --list \
--title "Liste des profils" \
--text "Choisir un profil dans la liste" \
--column "Fichier de profil"\
) && . "$dossierprofil"/"$fichierprofil".conf
fi
if [ "$fichierprofil" = "" ]; then
@ -133,23 +138,27 @@ qu\nQUITTER\
fi
elif [ "$choixmenu" = "ms" ];then
# Monter une archive
# Monter une archive
if [ "$filter" = "" ];then
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
BorgList="borg list --short $borg_repo"
else
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
BorgList="borg list --short $borg_repo | grep $filter"
fi
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>"
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 --width=500 $H $iconborg --list --title "Liste des points de montages" --column "Archive")
if [ "$ptnmontage" != "" ];then
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
sleep 2 | ZenityPulsate
rmdir $ptnmontage | ZenityPulsate