Skip to content

Commit

Permalink
Merge pull request #1 from fcrozat/main
Browse files Browse the repository at this point in the history
Fix incorrect encoding of parameters
  • Loading branch information
nbanb authored Nov 23, 2022
2 parents ea80325 + fa9c9de commit 6a9f655
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fbxvm-ctrl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ feed_vm_variables () {
[[ "${nameparam}" == "vcpus" ]] && vcpus[$idvm]=${valueparam}
[[ "${nameparam}" == "memory" ]] && memory[$idvm]=${valueparam}
[[ "${nameparam}" == "disk_type" ]] && disk_type[$idvm]=${valueparam}
[[ "${nameparam}" == "disk_path" ]] && disk_path[$idvm]=$(echo ${valueparam}|base64)
[[ "${nameparam}" == "disk_path" ]] && disk_path[$idvm]=$(echo -n ${valueparam}|base64)
[[ "${nameparam}" == "cd_path" ]] && cd_path[$idvm]=$(echo ${valueparam}|base64)
[[ "${nameparam}" == "enable_screen" ]] && enable_screen[$idvm]=${valueparam}
[[ "${nameparam}" == "bind_usb_ports" ]] && bind_usb=1 && usb[$idvm]=${valueparam}
Expand All @@ -195,7 +195,7 @@ feed_vm_variables () {
[[ "${nameparam}" == "cloudinit_hostname" ]] && cloudinit_hostname[$idvm]=${valueparam}
[[ "${nameparam}" == "cloudinit_userdata" ]] && ci_userdata=1 \
&& local ud=$(sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g' ${valueparam}) \
&& userdata[$idvm]=$(echo ${ud}) # converting yaml file to one-line yaml
&& userdata[$idvm]=$ud # converting yaml file to one-line yaml

((idparam++))

Expand Down Expand Up @@ -240,7 +240,7 @@ create_vm_variables () {
[[ "${nameparam}" == "vcpus" ]] && local vcpus=${valueparam}
[[ "${nameparam}" == "memory" ]] && local memory=${valueparam}
[[ "${nameparam}" == "disk_type" ]] && local disk_type=${valueparam}
[[ "${nameparam}" == "disk_path" ]] && local disk_path=$(echo ${valueparam}|base64)
[[ "${nameparam}" == "disk_path" ]] && local disk_path=$(echo -n ${valueparam}|base64)
[[ "${nameparam}" == "cd_path" ]] && local cd_path=$(echo ${valueparam}|base64)
[[ "${nameparam}" == "enable_screen" ]] && local enable_screen=${valueparam}
[[ "${nameparam}" == "bind_usb_ports" ]] && local usb=${valueparam}
Expand All @@ -249,7 +249,7 @@ create_vm_variables () {
[[ "${nameparam}" == "cloudinit_hostname" ]] && local cloudinit_hostname=${valueparam}
[[ "${nameparam}" == "cloudinit_userdata" ]] \
&& local ud=$(sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g' ${valueparam}) \
&& local userdata=$(echo ${ud}) # converting yaml file to one-line yaml
&& local userdata=$ud # converting yaml file to one-line yaml

#echo "idparam $idparam : param[$idparam] : ${param[$idparam]}" #debug
((idparam++))
Expand Down

0 comments on commit 6a9f655

Please sign in to comment.