aboutsummaryrefslogtreecommitdiff
path: root/ssh.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.sh')
-rwxr-xr-xssh.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssh.sh b/ssh.sh
index 50d801f..b020508 100755
--- a/ssh.sh
+++ b/ssh.sh
@@ -4,7 +4,7 @@
# Port and input for pass are optional
hostsfile="$HOME/.hosts"
-hostnames="$(sed '/^#.*$/d' < "$hostsfile" | cut -d'#' -f1 | fzf)"
+hostnames="$(sed '/^#.*$/d' < "$hostsfile" | cut -d'#' -f1 | fzf)" || exit 0
host="$(grep "$hostnames" < "$hostsfile")"
hostname="$(echo "$host" | cut -d'#' -f1)"
hostaddress="$(echo "$host" | cut -d'#' -f2)"