feat(scripts): ssh connect helper

This commit is contained in:
Florian Schmitt 2024-12-08 11:40:30 +03:00
parent 2de2f1722a
commit 8ab3402690
2 changed files with 14 additions and 0 deletions

13
scripts/ssh-connect Executable file
View 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