diff --git a/misc/build.func b/misc/build.func index 53509780f..6c5d20bfc 100644 --- a/misc/build.func +++ b/misc/build.func @@ -3600,9 +3600,9 @@ configure_ssh_settings() { glob_path=$(whiptail --backtitle "$backtitle" \ --inputbox "Enter a folder or glob to scan (e.g. /root/.ssh/*.pub)" 10 72 --title "Scan Folder/Glob" 3>&1 1>&2 2>&3) if [[ -n "$glob_path" ]]; then - shopt -s nullglob - read -r -a _scan_files <<<"$glob_path" - shopt -u nullglob + [[ -d "$glob_path" ]] && glob_path="${glob_path%/}/*" + local -a _scan_files + mapfile -t _scan_files < <(compgen -G "$glob_path") if [[ "${#_scan_files[@]}" -gt 0 ]]; then ssh_build_choices_from_files "${_scan_files[@]}" if [[ "$COUNT" -gt 0 ]]; then