feat: ask before restoration
This commit is contained in:
@@ -95,6 +95,8 @@ function restore_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function restore() {
|
function restore() {
|
||||||
|
local READ_RESTORE_CONTINUE
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-p|--password)
|
-p|--password)
|
||||||
@@ -131,5 +133,9 @@ function restore() {
|
|||||||
|
|
||||||
mkdir -p ${DATA_DIR}
|
mkdir -p ${DATA_DIR}
|
||||||
|
|
||||||
|
color yellow "Restore will overwrite the existing files, continue? (y/N)"
|
||||||
|
read -p "(Default: n): " READ_RESTORE_CONTINUE
|
||||||
|
if [[ $(echo "${READ_RESTORE_CONTINUE:-n}" | tr [a-z] [A-Z]) == "Y" ]]; then
|
||||||
restore_file
|
restore_file
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user