prise en charge du bouton annuler dans les menus

This commit is contained in:
Djan GICQUEL 2021-07-19 20:16:02 +02:00
parent 27c9b1dd89
commit 07daeaf257

View File

@ -130,23 +130,34 @@ if [ "$choixmenu" = "cs" ] ;then
elif [ "$choixmenu" = "ms" ];then
# Monter une archive
if [ "$filter" = "" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
else
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity --height=500 --list --title "Listes des archives" --column "Archive")
fi
if [ "$filter" = "" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
else
borg_archive=$(borg list --short $borg_repo | grep $filter | zenity --height=500 --list --title "Listes des archives" --column "Archive")
fi
if [ "$borg_archive" = "" ];then
zenity --width=600 --info --text "Aucune archive choisie, retour au menu"
else
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>"
fi
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>"
elif [ "$choixmenu" = "dm" ];then
# Demonter une archive
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 --height=400 --list --title "Liste des points de montages" --column "Archive")
fusermount -u $ptnmontage | zenity --width=600 --progress --pulsate --auto-close
sleep 5 | zenity --width=600 --progress --pulsate --auto-close
rmdir $ptnmontage | zenity --width=600 --progress --pulsate --auto-close
if [ "$ptnmontage" = "" ];then
zenity --width=600 --info --text "Aucune option choisie, retour au menu"
else
fusermount -u $ptnmontage | zenity --width=600 --progress --pulsate --auto-close
sleep 5 | zenity --width=600 --progress --pulsate --auto-close
rmdir $ptnmontage | zenity --width=600 --progress --pulsate --auto-close
fi
elif [ "$choixmenu" = "ss" ];then
# Supprimmer une archive
@ -197,6 +208,6 @@ elif [ "$choixmenu" = "ap" ];then
zenity --width=600 --height=400 --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
elif [ "$choixmenu" = "" ];then
zenity --width=600 --info --text="Aucun choix, retour au menu."
exit
fi
done