Use += instead of = to avoid clobbering the existing contents

This commit is contained in:
David Thurstenson 2020-08-12 10:12:50 -05:00
parent 8925975206
commit 3c70bfa2fa
1 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ declare -A cmdstring
declare -A uri declare -A uri
declare -a opts declare -a opts
cmdstring[domain]="win10" cmdstring=([domain]="win10")
uri=([remote]="qemu+ssh://kd-laptop/system" uri=([remote]="qemu+ssh://kd-laptop/system"
[remotespice]="spice://10.10.0.14:5900" [remotespice]="spice://10.10.0.14:5900"
@ -15,7 +15,7 @@ uri=([remote]="qemu+ssh://kd-laptop/system"
case "$(uname -n)" in case "$(uname -n)" in
kd-laptop) kd-laptop)
cmdstring=([cmd]="virt-viewer" cmdstring+=([cmd]="virt-viewer"
[uri]=${uri[local]} [uri]=${uri[local]}
[manuri]=${uri[local]}) [manuri]=${uri[local]})
opts=("--connect=${cmdstring[uri]}" opts=("--connect=${cmdstring[uri]}"
@ -25,7 +25,7 @@ case "$(uname -n)" in
"${cmdstring[domain]}") "${cmdstring[domain]}")
;; ;;
*) *)
cmdstring=([cmd]="remote-viewer" cmdstring+=([cmd]="remote-viewer"
[uri]=${uri[remotespice]} [uri]=${uri[remotespice]}
[manuri]=${uri[remote]}) [manuri]=${uri[remote]})
opts=("${cmdstring[uri]}") opts=("${cmdstring[uri]}")
@ -35,7 +35,7 @@ esac
while :; do while :; do
case $1 in case $1 in
-m) -m)
cmdstring=([cmd]="virt-manager") cmdstring+=([cmd]="virt-manager")
opts=("--connect=${cmdstring[manuri]}" opts=("--connect=${cmdstring[manuri]}"
"--show-domain-editor") "--show-domain-editor")
;; ;;