cnssh: ssh doesn't support setting Host as an option

This commit is contained in:
David Thurstenson 2021-05-06 16:25:04 -05:00
parent 85380e3a27
commit 7e9aa6fdb5
1 changed files with 4 additions and 3 deletions

View File

@ -98,10 +98,10 @@ cnssh() { # Helper for sshing into Crestron devices
# Set ssh host if not using sftp mode
case ${cnssh_conf[method]} in
ssh)
sshopts[Host]="${cnssh_conf[addr]}"
:
;;
sftp)
:
unset "cnssh_conf[cmd]"
;;
*)
echo "Unknown method: ${cnssh_conf[method]}"
@ -122,6 +122,7 @@ cnssh() { # Helper for sshing into Crestron devices
printf '%s %s=%s ' "-o" "$opt" "${sshopts[$opt]}"
done
) \
"${cnssh_conf[addr]}" \
"${cnssh_conf[cmd]}"
# Main
@ -137,7 +138,7 @@ cnsftp() {
# Set sftp mode instead of ssh
cnssh_conf[method]="sftp"
cnssh_conf[cmd]="$*"
cnssh_conf[addr]="$*"
cnssh
}