Browse Source

chg: [0km] better logs when opening ssh fails

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
rc1
Valentin Lab 4 years ago
parent
commit
242aa6080a
  1. 13
      bin/0km

13
bin/0km

@ -73,14 +73,15 @@ ssh:open() {
esac
shift
done
"${ssh_cmd[@]}" -o ControlPath=/tmp/ssh-control-master-${master_pid} \
full_cmd=(
"${ssh_cmd[@]}"
-o ControlPath=/tmp/ssh-control-master-${master_pid}-$hostname \
-o ControlMaster=auto -o ControlPersist=900 \
-o ConnectTimeout=5 -o "StrictHostKeyChecking=no" \
-o ConnectTimeout=5 -o StrictHostKeyChecking=no \
"${ssh_options[@]}" \
"$hostname" "$@" -- true || {
err Failed: ssh -o ControlPath=/tmp/ssh-control-master-${master_pid} \
-o ControlMaster=auto -o ControlPersist=900 \
"$hostname" "$@" -- true
"$hostname" "$@" -- true)
"${full_cmd[@]}" </dev/null >/dev/null 2>&1 || {
err "Failed: ${full_cmd[*]}"
return 1
}
trap_add EXIT,INT 'ssh:quit "$hostname"'

Loading…
Cancel
Save