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
|
# MENU PRINCIPAL Gestion des options du menu
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
|
while [ ! "$choixmenu" = "qu" ];do
|
||||||
choixmenu=$(echo -e "\
|
choixmenu=$(echo -e "\
|
||||||
cs\nCréer une archive\n\
|
cs\nCréer une archive\n\
|
||||||
ms\nMonter une archive\n\
|
ms\nMonter une archive\n\
|
||||||
@ -108,17 +109,16 @@ fi\nFiltre : "$filter"\n\
|
|||||||
id\nInformation sur le dépôt\n\
|
id\nInformation sur le dépôt\n\
|
||||||
ap\nAfficher le profil\n\
|
ap\nAfficher le profil\n\
|
||||||
--\n------------------------------------------\n\
|
--\n------------------------------------------\n\
|
||||||
ed\nEspace disque utilisé : $(df -k --output=pcent $borg_repo | tail -n +2)" \
|
ed\nEspace disque utilisé : $(df -k --output=pcent $borg_repo | tail -n +2)\n\
|
||||||
| zenity $iconborg --list \
|
qu\nQUITTER\
|
||||||
$H $W \
|
" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \
|
||||||
--title "BORG GUI : $nomsauvegarde" \
|
|
||||||
--hide-header --hide-column=1 --column "id" --column "choix")
|
--hide-header --hide-column=1 --column "id" --column "choix")
|
||||||
|
|
||||||
if [ "$choixmenu" = "" ];then
|
if [ "$choixmenu" = "" ];then
|
||||||
exit
|
echo ""
|
||||||
|
|
||||||
elif [ "$choixmenu" = "cs" ];then
|
elif [ "$choixmenu" = "cs" ];then
|
||||||
# Créer une archive
|
# Créer une archive
|
||||||
|
|
||||||
TestBorgRepo
|
TestBorgRepo
|
||||||
|
|
||||||
@ -132,8 +132,8 @@ elif [ "$choixmenu" = "cs" ];then
|
|||||||
zenity $W --info --text "Sauvegarde $nomsauvegarde terminée"
|
zenity $W --info --text "Sauvegarde $nomsauvegarde terminée"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "$choixmenu" = "ms" ];then
|
elif [ "$choixmenu" = "ms" ];then
|
||||||
# Monter une archive
|
# Monter une archive
|
||||||
|
|
||||||
if [ "$filter" = "" ];then
|
if [ "$filter" = "" ];then
|
||||||
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
|
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
|
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>"
|
zenity $W --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
|
||||||
|
|
||||||
elif [ "$choixmenu" = "dm" ];then
|
elif [ "$choixmenu" = "dm" ];then
|
||||||
# Demonter une archive
|
# Demonter une archive
|
||||||
|
|
||||||
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 $H $iconborg --list --title "Liste des points de montages" --column "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
|
if [ "$ptnmontage" != "" ];then
|
||||||
@ -155,8 +155,8 @@ elif [ "$choixmenu" = "dm" ];then
|
|||||||
rmdir $ptnmontage | ZenityPulsate
|
rmdir $ptnmontage | ZenityPulsate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "$choixmenu" = "ss" ];then
|
elif [ "$choixmenu" = "ss" ];then
|
||||||
# Supprimmer une archive
|
# Supprimmer une archive
|
||||||
|
|
||||||
if [ "$filter" = "" ];then
|
if [ "$filter" = "" ];then
|
||||||
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
elif [ "$choixmenu" = "is" ];then
|
elif [ "$choixmenu" = "is" ];then
|
||||||
# Information archive
|
# Information archive
|
||||||
|
|
||||||
if [ "$filter" = "" ];then
|
if [ "$filter" = "" ];then
|
||||||
borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive")
|
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
|
zenity $W --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>" | ZenityPulsate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "$choixmenu" = "fi" ];then
|
elif [ "$choixmenu" = "fi" ];then
|
||||||
#Filtre
|
#Filtre
|
||||||
|
|
||||||
filter=$(zenity --entry)
|
filter=$(zenity --entry)
|
||||||
|
|
||||||
elif [ "$choixmenu" = "id" ];then
|
elif [ "$choixmenu" = "id" ];then
|
||||||
# Information sur le dépôt
|
# Information sur le dépôt
|
||||||
|
|
||||||
zenity $W --info --text="<tt>$(borg info $borg_repo)</tt>" | ZenityPulsate
|
zenity $W --info --text="<tt>$(borg info $borg_repo)</tt>" | ZenityPulsate
|
||||||
|
|
||||||
elif [ "$choixmenu" = "ap" ];then
|
elif [ "$choixmenu" = "ap" ];then
|
||||||
# Afficher le profil
|
# Afficher le profil
|
||||||
|
|
||||||
zenity $W $H --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
|
zenity $W $H --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
|
||||||
|
|
||||||
elif [ "$choixmenu" = "qu" ];then
|
fi
|
||||||
exit
|
done
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user