correction menu principal du dépôt avec boucle while
This commit is contained in:
parent
15b08837a4
commit
d3681acba6
49
borg-gui.sh
49
borg-gui.sh
@ -97,6 +97,7 @@ TestBorgRepo
|
||||
# MENU PRINCIPAL Gestion des options du menu
|
||||
#################################################################################
|
||||
|
||||
while [ ! "$choixmenu" = "qu" ];do
|
||||
choixmenu=$(echo -e "\
|
||||
cs\nCréer une archive\n\
|
||||
ms\nMonter une archive\n\
|
||||
@ -108,17 +109,16 @@ fi\nFiltre : "$filter"\n\
|
||||
id\nInformation sur le dépôt\n\
|
||||
ap\nAfficher le profil\n\
|
||||
--\n------------------------------------------\n\
|
||||
ed\nEspace disque utilisé : $(df -k --output=pcent $borg_repo | tail -n +2)" \
|
||||
| zenity $iconborg --list \
|
||||
$H $W \
|
||||
--title "BORG GUI : $nomsauvegarde" \
|
||||
ed\nEspace disque utilisé : $(df -k --output=pcent $borg_repo | tail -n +2)\n\
|
||||
qu\nQUITTER\
|
||||
" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \
|
||||
--hide-header --hide-column=1 --column "id" --column "choix")
|
||||
|
||||
if [ "$choixmenu" = "" ];then
|
||||
exit
|
||||
if [ "$choixmenu" = "" ];then
|
||||
echo ""
|
||||
|
||||
elif [ "$choixmenu" = "cs" ];then
|
||||
# Créer une archive
|
||||
elif [ "$choixmenu" = "cs" ];then
|
||||
# Créer une archive
|
||||
|
||||
TestBorgRepo
|
||||
|
||||
@ -132,8 +132,8 @@ elif [ "$choixmenu" = "cs" ];then
|
||||
zenity $W --info --text "Sauvegarde $nomsauvegarde terminée"
|
||||
fi
|
||||
|
||||
elif [ "$choixmenu" = "ms" ];then
|
||||
# Monter une archive
|
||||
elif [ "$choixmenu" = "ms" ];then
|
||||
# Monter une archive
|
||||
|
||||
if [ "$filter" = "" ];then
|
||||
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
|
||||
@ -145,8 +145,8 @@ elif [ "$choixmenu" = "ms" ];then
|
||||
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>"
|
||||
|
||||
elif [ "$choixmenu" = "dm" ];then
|
||||
# Demonter une archive
|
||||
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
|
||||
@ -155,8 +155,8 @@ elif [ "$choixmenu" = "dm" ];then
|
||||
rmdir $ptnmontage | ZenityPulsate
|
||||
fi
|
||||
|
||||
elif [ "$choixmenu" = "ss" ];then
|
||||
# Supprimmer une archive
|
||||
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")
|
||||
@ -173,8 +173,8 @@ elif [ "$choixmenu" = "ss" ];then
|
||||
fi
|
||||
|
||||
|
||||
elif [ "$choixmenu" = "is" ];then
|
||||
# Information archive
|
||||
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")
|
||||
@ -188,21 +188,20 @@ elif [ "$choixmenu" = "is" ];then
|
||||
zenity $W --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>" | ZenityPulsate
|
||||
fi
|
||||
|
||||
elif [ "$choixmenu" = "fi" ];then
|
||||
#Filtre
|
||||
elif [ "$choixmenu" = "fi" ];then
|
||||
#Filtre
|
||||
|
||||
filter=$(zenity --entry)
|
||||
|
||||
elif [ "$choixmenu" = "id" ];then
|
||||
# Information sur le dépôt
|
||||
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
|
||||
elif [ "$choixmenu" = "ap" ];then
|
||||
# Afficher le profil
|
||||
|
||||
zenity $W $H --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
|
||||
|
||||
elif [ "$choixmenu" = "qu" ];then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user