diff --git a/.bashrc.d/cnssh.bash b/.bashrc.d/cnssh.bash index 6bc3b9c..18d3915 100644 --- a/.bashrc.d/cnssh.bash +++ b/.bashrc.d/cnssh.bash @@ -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 }