mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2025-09-06 21:00:45 +02:00
Fix host number selection to match display order in list command
This commit is contained in:
parent
e2b1ba6e23
commit
411199595f
@ -157,7 +157,7 @@ sshm_connect() {
|
||||
|
||||
if [[ "$host" =~ ^[0-9]+$ ]]; then
|
||||
local host_name
|
||||
host_name=$(grep -E '^Host ' "$config_file" | awk '{print $2}' | grep -v '^#' | sed -n "${host}p")
|
||||
host_name=$(grep -E '^Host ' "$config_file" | awk '{print $2}' | grep -v '^#' | sort | sed -n "${host}p")
|
||||
if [[ -n "$host_name" ]]; then
|
||||
echo -e "\n${GREEN}Connecting to $host_name...${NC}\n"
|
||||
ssh -F "$config_file" "$host_name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user