From 5e675ab7ae08611a5aea4748aa5a640e99840c19 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Tue, 27 Dec 2022 16:27:44 +0100 Subject: [PATCH] Fix heavybugs --- functions/backup.sh | 1 + includes/backup.sh | 10 ++++++++++ truetool.sh | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 includes/backup.sh diff --git a/functions/backup.sh b/functions/backup.sh index c94b0afb..46ffa330 100755 --- a/functions/backup.sh +++ b/functions/backup.sh @@ -98,6 +98,7 @@ do read -rt 120 -p "Delete more backups? (y/N): " yesno || { echo -e "\nFailed to make a selection in time" ; exit; } case $yesno in [Yy] | [Yy][Ee][Ss]) + deleteBackup break ;; [Nn] | [Nn][Oo]) diff --git a/includes/backup.sh b/includes/backup.sh new file mode 100644 index 00000000..9308664d --- /dev/null +++ b/includes/backup.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +## Simple shortcut to just list the backups without promts and such +listBackups(){ +echo -e "${BWhite}Backup Listing Tool${Color_Off}" +clear -x && echo "pulling all restore points.." +list_backups=$(cli -c 'app kubernetes list_backups' | grep -v system-update | sort -t '_' -Vr -k2,7 | tr -d " \t\r" | awk -F '|' '{print $2}' | nl | column -t) +[[ -z "$list_backups" ]] && echo -e "${IRed}No restore points available${Color_Off}" && exit || echo "Detected Backups:" && echo "$list_backups" +} +export -f listBackups diff --git a/truetool.sh b/truetool.sh index add90b39..ee61aa82 100755 --- a/truetool.sh +++ b/truetool.sh @@ -24,6 +24,8 @@ source includes/no_args.sh source includes/title.sh # shellcheck source=includes/update_self.sh source includes/update_self.sh +# shellcheck source=includes/backup.sh +source includes/backup.sh # Libraries loaded from Heavyscript # shellcheck source=functions/dns.sh