ussh: problèmes de compatibilité

This commit is contained in:
Jephté Clain 2017-07-29 23:02:39 +04:00
parent 2cc24119b5
commit 2f448d542d
1 changed files with 11 additions and 5 deletions

16
ussh
View File

@ -343,15 +343,18 @@ function __update_sshopts_cm() {
version="$(ssh -V 2>&1)" version="$(ssh -V 2>&1)"
version="${version#OpenSSH_}"; major="${version%%.*}" version="${version#OpenSSH_}"; major="${version%%.*}"
minor="${version#$major.}"; minor="${minor:0:1}" 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" persist="$DEFAULT_PERSIST"
elif [ $major -eq 5 ]; then elif [ "$major" -eq 5 ]; then
if [ "$minor" -ge 6 ]; then if [ "$minor" -ge 6 ]; then
persist="$DEFAULT_PERSIST" persist="$DEFAULT_PERSIST"
else else
persist= persist=
fi fi
elif [ $major -le 4 ]; then elif [ "$major" -le 4 ]; then
persist= persist=
fi fi
fi fi
@ -383,7 +386,10 @@ function show_vars() {
function do_ssh() { function do_ssh() {
local -a sshopts local -a sshopts
local onehost r local onehost r
if [ "${#hosts[*]}" -gt 1 ]; then if [ $# -eq 0 ]; then
${exec:+exec} "$SSH" "${SSHOPTS[@]}"
return
elif [ "${#hosts[*]}" -gt 1 ]; then
onehost= onehost=
exec= exec=
else else
@ -447,7 +453,7 @@ if [ -n "$remove" ]; then
hosts=("$1"); shift hosts=("$1"); shift
fix_hosts fix_hosts
remove_keys remove_keys
else elif [ -n "$1" ]; then
hosts=("$1"); shift hosts=("$1"); shift
fix_hosts fix_hosts
fi fi