feat: add more scripts
Some checks failed
CI / fmt (push) Failing after 2s
CI / check (push) Failing after 2s

This commit is contained in:
Nickolaj Jepsen 2026-01-22 23:12:42 +01:00
parent cd289da742
commit 575db8e773
7 changed files with 99 additions and 9 deletions

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
# Extract hosts from config and known_hosts
# shellcheck disable=SC2002
hosts=$(cat ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -P "^Host ([^*]+)$" | awk '{print $2}' ; cat ~/.ssh/known_hosts 2>/dev/null | cut -f 1 -d ' ' | sed -e 's/,.*//g' | sort -u)
selected=$(echo "$hosts" | fzf --prompt="SSH > " --height=20% --layout=reverse)
if [ -n "$selected" ]; then
echo "Connecting to $selected..."
ssh "$selected"
fi