refactor: clean up configure_file_sharing()

This commit is contained in:
Martin Wimpress 2024-05-14 10:42:53 +01:00 committed by Martin Wimpress
parent 0b892f82a0
commit f17cfe4e78
1 changed files with 20 additions and 19 deletions

View File

@ -876,6 +876,7 @@ function configure_ports() {
function configure_file_sharing() {
if [ -n "${PUBLIC}" ]; then
# WebDAV
case ${guest_os} in
macos)
if [ "${display}" == "none" ] || [ "${display}" == "spice" ] || [ "${display}" == "spice-app" ]; then
@ -883,12 +884,11 @@ function configure_file_sharing() {
echo " - WebDAV: On guest: build spice-webdavd (https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24)"
echo " - WebDAV: On guest: Finder -> Connect to Server -> http://localhost:9843/"
fi;;
*)
echo " - WebDAV: On guest: dav://localhost:9843/";;
*) echo " - WebDAV: On guest: dav://localhost:9843/";;
esac
fi
if [ "${guest_os}" != "windows" ] || [ "${guest_os}" == "windows-server" ] && [ -n "${PUBLIC}" ]; then
# 9P
if [ "${guest_os}" != "windows" ] || [ "${guest_os}" == "windows-server" ]; then
echo -n " - 9P: On guest: "
if [ "${guest_os}" == "linux" ]; then
echo "sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 ${PUBLIC_TAG} ~/$(basename "${PUBLIC}")"
@ -903,11 +903,12 @@ function configure_file_sharing() {
fi
fi
# If smbd is available and ~/Public is present export it to the guest via samba
if [[ -x "$(command -v smbd)" && -n ${PUBLIC} ]]; then
# SMB
if [ -x "$(command -v smbd)" ]; then
NET+=",smb=${PUBLIC}"
echo " - smbd: On guest: smb://10.0.2.4/qemu"
fi
fi
}
function configure_tpm() {