From 2f448d542d451999e6595bf641f0291f1048f437 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sat, 29 Jul 2017 23:02:39 +0400 Subject: [PATCH] =?UTF-8?q?ussh:=20probl=C3=A8mes=20de=20compatibilit?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ussh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ussh b/ussh index 104706f..de2b92c 100755 --- a/ussh +++ b/ussh @@ -343,15 +343,18 @@ function __update_sshopts_cm() { version="$(ssh -V 2>&1)" version="${version#OpenSSH_}"; major="${version%%.*}" minor="${version#$major.}"; minor="${minor:0:1}" - if [ $major -ge 6 ]; then + if [ -z "$major" ]; then + # ne devrait pas se produire... mais au cas où + persist= + elif [ "$major" -ge 6 ]; then persist="$DEFAULT_PERSIST" - elif [ $major -eq 5 ]; then + elif [ "$major" -eq 5 ]; then if [ "$minor" -ge 6 ]; then persist="$DEFAULT_PERSIST" else persist= fi - elif [ $major -le 4 ]; then + elif [ "$major" -le 4 ]; then persist= fi fi @@ -383,7 +386,10 @@ function show_vars() { function do_ssh() { local -a sshopts local onehost r - if [ "${#hosts[*]}" -gt 1 ]; then + if [ $# -eq 0 ]; then + ${exec:+exec} "$SSH" "${SSHOPTS[@]}" + return + elif [ "${#hosts[*]}" -gt 1 ]; then onehost= exec= else @@ -447,7 +453,7 @@ if [ -n "$remove" ]; then hosts=("$1"); shift fix_hosts remove_keys -else +elif [ -n "$1" ]; then hosts=("$1"); shift fix_hosts fi