From 87f68221a324141cbd5aa79fdbb966555d964692 Mon Sep 17 00:00:00 2001 From: paukstelis Date: Thu, 16 Jun 2022 20:45:28 -0400 Subject: [PATCH] restore menu --- octoprint_deploy.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/octoprint_deploy.sh b/octoprint_deploy.sh index 5413759..a9e2ebc 100755 --- a/octoprint_deploy.sh +++ b/octoprint_deploy.sh @@ -934,8 +934,9 @@ create_menu() { echo "Selected instance to backup: $opt" | log back_up $opt + main_menu done - main_menu + } @@ -960,6 +961,22 @@ back_up() { echo "Tarred and gzipped backup created in /home/$user" } +restore_menu() { + PS3='Select backup to restore: ' + readarray -t options < <(ls /home/$user/*.tar.gz) + options+=("Quit") + select opt in "${options[@]}" + do + if [ "$opt" == Quit ] || [ "$opt" == generic ]; then + main_menu + fi + + echo "Selected $opt to restore" | log + tar -xvf $opt + main_menu + done +} + restore() { INSTANCE=$1 TAR=$2