Assorted shell and Python scripts

Check if selection != 'user aborted'

Changed files
+3 -3
+3 -3
gumssh
···
# Print each member of logins array on a new line and pipe to gum choose.
# Store selection.
-
selection=$(printf "%s\n" "${hostn_array[@]}" | gum choose --limit=1)
-
# If $selection is non-empty, pass it to the ssh -X command.
-
if test -n "${selection}"; then
autossh -M 0 "${selection}"
fi
···
# Print each member of logins array on a new line and pipe to gum choose.
# Store selection.
+
selection=$(printf "%s\n" "${hostn_array[@]}" | gum choose --header="SSH Host" --limit=1)
+
# If $selection is not aborted by user, pass it to the `autossh -M 0` command.
+
if [ "${selection}" != "user aborted" ]; then
autossh -M 0 "${selection}"
fi