cnssh: Read out sshopts when needed instead of involving an intermediary variable
This commit is contained in:
parent
397f7bd166
commit
85380e3a27
|
@ -108,10 +108,6 @@ cnssh() { # Helper for sshing into Crestron devices
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
for opt in "${!sshopts[@]}"; do
|
|
||||||
sshoptstring="$sshoptstring -o $opt=${sshopts[$opt]}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Option Parsing
|
# Option Parsing
|
||||||
####
|
####
|
||||||
|
|
||||||
|
@ -121,7 +117,11 @@ cnssh() { # Helper for sshing into Crestron devices
|
||||||
|
|
||||||
sshpass -p "${cnssh_conf[pass]}" \
|
sshpass -p "${cnssh_conf[pass]}" \
|
||||||
"${cnssh_conf[method]}" \
|
"${cnssh_conf[method]}" \
|
||||||
$sshoptstring \
|
$( # Format sshopts as a string that an ssh program understands
|
||||||
|
for opt in "${!sshopts[@]}"; do
|
||||||
|
printf '%s %s=%s ' "-o" "$opt" "${sshopts[$opt]}"
|
||||||
|
done
|
||||||
|
) \
|
||||||
"${cnssh_conf[cmd]}"
|
"${cnssh_conf[cmd]}"
|
||||||
|
|
||||||
# Main
|
# Main
|
||||||
|
|
Loading…
Reference in New Issue