Merge branch 'main' into 4.x

This commit is contained in:
Dave Conroy
2023-11-09 11:48:08 -08:00
committed by GitHub
2 changed files with 35 additions and 1 deletions

View File

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