diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc index f1d83fb6..6dd226de 100644 --- a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc +++ b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc @@ -40,9 +40,9 @@ setup_ethernet() { # Remove lines that could break things sed -i "/^${eth}\.connectionType/Id;/^${eth}\.present/Id" "${TMPCONFIG}" # Set up devType - devline= if ! grep -q -i "^${eth}\.virtualDev" "${TMPCONFIG}" && [ -n "$devtype" ]; then devline="${eth}.virtualDev = "'"'"${devtype}"'"' + echo "${devline}" >> "${TMPCONFIG}" fi cat >> "${TMPCONFIG}" <<-HEND ${eth}.connectionType = "custom" @@ -50,7 +50,6 @@ setup_ethernet() { ${eth}.vnet = "vmnet${vmnet}" ${eth}.addressType = "static" ${eth}.address = "${mac}" - ${devline} HEND done fi @@ -336,7 +335,7 @@ write_final_vmx() { finalize_hardware # Killing duplicate entries; always keep last value: - awk -F= '{ + awk -F= 'NF{ b = $0; gsub(/^[ \t]+|[ \t]+$/, "", $1); gsub(/^[ \t]*[^ \t]+[ \t]*=[ \t]*|[ \t]+$/, "", b); @@ -347,6 +346,8 @@ write_final_vmx() { }' "${TMPCONFIG}" > "${TMPCONFIG}.tmp" \ && mv -f "${TMPCONFIG}.tmp" "${TMPCONFIG}" + sort -o "${TMPCONFIG}" "${TMPCONFIG}" + # At last: Let's copy it to $VM_CONF_DIR/run-vmware.conf if cp -p "${TMPCONFIG}" "${VM_RUN_FILE}"; then writelog "Copied '${TMPCONFIG}' to '${VM_RUN_FILE}'" |