mirror of
https://github.com/Threnklyn/ssh-config-manager.git
synced 2026-06-05 21:18:28 +02:00
fixed problem with same host names
This commit is contained in:
Regular → Executable
+2
-3
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#================== Globals ==================================================
|
#================== Globals ==================================================
|
||||||
# Version
|
# Version
|
||||||
VERSION="0.1"
|
VERSION="0.2"
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
HOST_FILE="$HOME/.ssh/config"
|
HOST_FILE="$HOME/.ssh/config"
|
||||||
@@ -66,7 +66,7 @@ function get_name (){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_addr (){
|
function get_addr (){
|
||||||
grep -A 1 "$1" $HOST_FILE|grep -i HostName|cut -d" " -f4
|
grep -A1 "$1" $HOST_FILE|grep -im1 HostName|cut -d" " -f4
|
||||||
}
|
}
|
||||||
|
|
||||||
function main (){
|
function main (){
|
||||||
@@ -79,7 +79,6 @@ function main (){
|
|||||||
printf "%15s\t(%2s)\t%s\n" $a $i $addr
|
printf "%15s\t(%2s)\t%s\n" $a $i $addr
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Connect with:" num
|
read -p "Connect with:" num
|
||||||
ssh -i $HOST_FILE ${arr[$num]}
|
ssh -i $HOST_FILE ${arr[$num]}
|
||||||
|
|||||||
Reference in New Issue
Block a user