fix(public_dir): respect public_dir setting when loading VM

- Read public_dir from the sourced VM config into PUBLIC
- Preserve existing PUBLIC when public_dir is not set
- Prevent PUBLIC being empty when a VM specifies public_dir

Fixes #1634

Signed-off-by: Martin Wimpress <martin@wimpress.org>
This commit is contained in:
Martin Wimpress 2026-01-23 17:53:32 +00:00 committed by Martin Wimpress
parent 59f908ea6d
commit d83db9843b
1 changed files with 1 additions and 0 deletions

View File

@ -2214,6 +2214,7 @@ fi
if [ -n "${VM}" ] && [ -e "${VM}" ]; then
# shellcheck source=/dev/null
source "${VM}"
PUBLIC="${public_dir:-${PUBLIC}}"
VMDIR=$(dirname "${disk_img}") # directory the VM disk and state files are stored
VMNAME=$(basename "${VM}" .conf) # name of the VM