mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2025-09-07 13:20:40 +02:00
Edited to include the correct ssh config file
This commit is contained in:
parent
8424b5d7b5
commit
4483054c5b
@ -77,17 +77,18 @@ ssh_manager_connect() {
|
|||||||
echo "Error: please provide a host number or name." 1>&2
|
echo "Error: please provide a host number or name." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$host" =~ ^[0-9]+$ ]]; then
|
if [[ "$host" =~ ^[0-9]+$ ]]; then
|
||||||
local host_name
|
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 '^#' | sed -n "${host}p")
|
||||||
if [ -n "$host_name" ]]; then
|
if [ -n "$host_name" ]]; then
|
||||||
ssh "$host_name"
|
ssh -F "$config_file" "$host_name"
|
||||||
else
|
else
|
||||||
echo "Invalid number." 1>&2
|
echo "Invalid number." 1>&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
ssh "$host"
|
ssh -F "$config_file" "$host"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user