restore menu

This commit is contained in:
paukstelis
2022-06-16 20:45:28 -04:00
parent 9085701563
commit 87f68221a3

View File

@@ -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