From 6d89fa1486fc78a2ffa10f8ed927c8af3fbf181f Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Wed, 11 May 2022 02:15:07 +0200 Subject: Make ssh use ssh.host properly --- CHANGELOG.md | 5 +++++ lib/subcommands/ssh.bash | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0411fe5..2be3885 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `var` subcommand is now referenced in `usage`. +### Changed + +- `ssh` subcommand should now only check for `ssh.host`, and show an appropriate + warning if one is not set for a node. + ## [1.0.0] - 2022-05-06 Initial release. diff --git a/lib/subcommands/ssh.bash b/lib/subcommands/ssh.bash index b5712cc..bc3fb9b 100644 --- a/lib/subcommands/ssh.bash +++ b/lib/subcommands/ssh.bash @@ -24,14 +24,12 @@ subcommand() local host user="$(config_for "$node" "ssh.user" "root")" - - # Try IPv6 first - host="$(config_for "$node" "ssh.host" "$(config_for "$node" "vpn.ipv6")")" + host="$(config_for "$node" "ssh.host" "$(config_for "$node" "vpn.ipv4")")" if [[ -z "$host" ]] then - # Otherwise try IPv4 - host="$(config_for "$node" "ssh.host" "$(config_for "$node" "vpn.ipv4")")" + crit "ssh" "ssh.host is not configured for $node" + continue fi notice "ssh" "$user@$node ($host) > $*" -- cgit v1.1