restore menu
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user