This commit is contained in:
2023-07-27 13:41:56 +02:00
parent 0679dd0cd4
commit ae9c44ba6c
7 changed files with 44 additions and 22 deletions

View File

@ -0,0 +1,12 @@
function s(){
# Get a list of all available SSH clients from the ~/.ssh/config file and pass them to fzf
selected_client=$(grep -E "^Host\s+" ~/.ssh/config | awk '{print $2}' | fzf)
# Check if a selection was made
if [ -n "$selected_client" ]; then
# Connect to the selected SSH client
ssh "$selected_client"
else
echo "No SSH client selected. Exiting."
fi
}