diff --git a/scripts/build-and-push.sh b/scripts/build-and-push.sh index a901c51..fc61487 100755 --- a/scripts/build-and-push.sh +++ b/scripts/build-and-push.sh @@ -134,6 +134,9 @@ resolve_ssh_alias() { local -a patterns # Force whitespace-aware splitting (the script's global IFS excludes spaces). local IFS=$' \t\n' + # SSH config directives are case-insensitive (HostName == Hostname == HOSTNAME). + # nocasematch is supported in bash 3.2 (unlike ${var,,} which needs 4+). + shopt -s nocasematch while read -r line || [[ -n "$line" ]]; do # First whitespace-separated token (tabs and spaces collapse uniformly). read -r first _ <<< "$line" @@ -163,6 +166,7 @@ resolve_ssh_alias() { esac fi done < "$config" + shopt -u nocasematch (( in_block )) \ || die "No matching Host entry in $config for alias '$alias'. Use user@host[:port] or check ~/.ssh/config."