diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-15 20:41:51 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-15 20:41:51 +0100 |
commit | 17d38e1b9c7abc590565bdc0817896aa54773e00 (patch) | |
tree | 4c3ff0a902f1612f34d8c067150282f87e8504d5 | |
parent | 3bf42f723a523735b2f5d9c7ba81d9bc0f88ea2d (diff) | |
download | scripts-17d38e1b9c7abc590565bdc0817896aa54773e00.tar.gz scripts-17d38e1b9c7abc590565bdc0817896aa54773e00.zip |
ssh.sh and scp.sh behave propery if fzf is exited.
-rwxr-xr-x | scp.sh | 2 | ||||
-rwxr-xr-x | ssh.sh | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -2,7 +2,7 @@ # Allows to select a host to send files to through scp 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)" @@ -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)" |