mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 13:23:12 +01:00
Merge branch 'main' into 4.x
This commit is contained in:
@@ -74,12 +74,40 @@ EOF
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
control_c() {
|
||||
#if [ -f "${restore_vars}" ] ; then rm -rf "${restore_vars}" ; fi
|
||||
if [ -f "${restore_vars}" ] ; then rm -rf "${restore_vars}" ; fi
|
||||
print_warn "User aborted"
|
||||
exit
|
||||
}
|
||||
|
||||
get_filename() {
|
||||
COLUMNS=12
|
||||
prompt="Please select a file to restore:"
|
||||
options=( $(find "${DEFAULT_FILESYSTEM_PATH}" -type f -maxdepth 2 -not -name '*.md5' -not -name '*.sha1' -print0 | sort -z | xargs -0) )
|
||||
PS3="$prompt "
|
||||
select opt in "${options[@]}" "Custom" "Quit" ; do
|
||||
if (( REPLY == 2 + ${#options[@]} )) ; then
|
||||
echo "Bye!"
|
||||
exit 2
|
||||
elif (( REPLY == 1 + ${#options[@]} )) ; then
|
||||
while [ ! -f "${opt}" ] ; do
|
||||
read -p "What path and filename to restore: " opt
|
||||
if [ ! -f "${opt}" ] ; then
|
||||
print_error "File not found. Please retry.."
|
||||
fi
|
||||
done
|
||||
break
|
||||
elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
|
||||
break
|
||||
else
|
||||
echo "Invalid option. Try another one."
|
||||
fi
|
||||
done
|
||||
COLUMNS=$oldcolumns
|
||||
r_filename=${opt}
|
||||
}
|
||||
|
||||
get_dbhost() {
|
||||
p_dbhost=$(basename -- "${r_filename}" | cut -d _ -f 3)
|
||||
if [ -n "${p_dbhost}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user