feat(scripts): ssh connect helper
This commit is contained in:
parent
2de2f1722a
commit
8ab3402690
2 changed files with 14 additions and 0 deletions
13
scripts/ssh-connect
Executable file
13
scripts/ssh-connect
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $# -eq 1 ]]; then
|
||||
selected=$1
|
||||
else
|
||||
selected=$(grep -P "^Host ([^*]+)$" $HOME/.ssh/config | sed 's/Host //' | sort -r -f | fzf)
|
||||
fi
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ssh $selected
|
Loading…
Add table
Add a link
Reference in a new issue