Skip to content

Commit c73d677

Browse files
committed
Don't assume ssh -G returns the hostname setting
1 parent d00d5b7 commit c73d677

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nixos-anywhere.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ main() {
839839
840840
sshSettings=$(ssh "${sshArgs[@]}" -G "${sshConnection}")
841841
sshUser=$(echo "$sshSettings" | awk '/^user / { print $2 }')
842-
sshHost=$(echo "$sshSettings" | awk '/^host / { print $2 }')
842+
sshHost="${sshConnection//*@/}"
843843
844844
uploadSshKey
845845

0 commit comments

Comments
 (0)