diff --git a/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh b/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh index 3fc0548..e71fc1d 100644 --- a/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh +++ b/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh @@ -35,14 +35,17 @@ zeditor-remote() { if [[ -r /etc/resolv.conf && -r "$HOME"/.ssh/known_hosts ]]; then local -a hosts readarray -d $'\n' -t hosts < <( - cut <"$HOME"/.ssh/known_hosts -d' ' -f1 | sort -u \ - | grep -E "(\\.$(hostname --domain)|^[^.]*)$" + cut <"$HOME"/.ssh/known_hosts -d' ' -f1 | sort -u \ + | grep -Ev '^([0-9]{0,3}\.){3}[0-9]{0,3}$' \ + | grep -Ev '^([0-9a-fA-F]{0,4}:){0,7}:?([0-9a-fA-F]{0,4}:){0,6}[0-9a-fA-F]{0,4}$' ) local -a domains readarray -d ' ' -t domains < <( grep /dev/null "$host" \ - fd "^\.git$" repos/ "${fdargs[@]}" -x printf "'ssh://%s/~/%q\n'" "'$host'" "'{//}'" + fd "^\.git$" repos/ "${fdargs[@]}" -L -x printf "'ssh://%s/~/%q\n'" "'$host'" "'{//}'" fi } $spin xe <<<"$host" -j"$(wc -l <<<"$host")" -s "$(declare -f worker); worker \"\$@\"" 2>/dev/null ||: