mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-25 10:23:42 +01:00
Check if selection != 'user aborted'
This commit is contained in:
parent
9440b57d09
commit
662ebf0182
6
gumssh
6
gumssh
@ -24,9 +24,9 @@ done < "${SSH_CONFIG}"
|
|||||||
|
|
||||||
# Print each member of logins array on a new line and pipe to gum choose.
|
# Print each member of logins array on a new line and pipe to gum choose.
|
||||||
# Store selection.
|
# Store selection.
|
||||||
selection=$(printf "%s\n" "${hostn_array[@]}" | gum choose --limit=1)
|
selection=$(printf "%s\n" "${hostn_array[@]}" | gum choose --header="SSH Host" --limit=1)
|
||||||
|
|
||||||
# If $selection is non-empty, pass it to the ssh -X command.
|
# If $selection is not aborted by user, pass it to the `autossh -M 0` command.
|
||||||
if test -n "${selection}"; then
|
if [ "${selection}" != "user aborted" ]; then
|
||||||
autossh -M 0 "${selection}"
|
autossh -M 0 "${selection}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user