error handling for ssh-host function
This commit is contained in:
parent
401157258e
commit
1446cc9948
|
|
@ -11,8 +11,12 @@ ssh() {
|
||||||
|
|
||||||
# Use fzf to find all your configured ssh connection
|
# Use fzf to find all your configured ssh connection
|
||||||
ssh-host() {
|
ssh-host() {
|
||||||
|
if [ "$(which fzf 2>/dev/null)" ]; then
|
||||||
ssh $(cat "$HOME/.ssh/config" "$HOME/.ssh/conf.d/individual_user" \
|
ssh $(cat "$HOME/.ssh/config" "$HOME/.ssh/conf.d/individual_user" \
|
||||||
| awk '$1 == "Host" && $2 != "*" {print $2}' | fzf --reverse)
|
| awk '$1 == "Host" && $2 != "*" {print $2}' | fzf --reverse)
|
||||||
|
else
|
||||||
|
echo "fzf not installed!"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Creates a new directory and immediately changes into it
|
# Creates a new directory and immediately changes into it
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue