refactor: clean up configure_file_sharing()
This commit is contained in:
parent
0b892f82a0
commit
f17cfe4e78
39
quickemu
39
quickemu
|
@ -876,6 +876,7 @@ function configure_ports() {
|
||||||
|
|
||||||
function configure_file_sharing() {
|
function configure_file_sharing() {
|
||||||
if [ -n "${PUBLIC}" ]; then
|
if [ -n "${PUBLIC}" ]; then
|
||||||
|
# WebDAV
|
||||||
case ${guest_os} in
|
case ${guest_os} in
|
||||||
macos)
|
macos)
|
||||||
if [ "${display}" == "none" ] || [ "${display}" == "spice" ] || [ "${display}" == "spice-app" ]; then
|
if [ "${display}" == "none" ] || [ "${display}" == "spice" ] || [ "${display}" == "spice-app" ]; then
|
||||||
|
@ -883,30 +884,30 @@ function configure_file_sharing() {
|
||||||
echo " - WebDAV: On guest: build spice-webdavd (https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24)"
|
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/"
|
echo " - WebDAV: On guest: Finder -> Connect to Server -> http://localhost:9843/"
|
||||||
fi;;
|
fi;;
|
||||||
*)
|
*) echo " - WebDAV: On guest: dav://localhost:9843/";;
|
||||||
echo " - WebDAV: On guest: dav://localhost:9843/";;
|
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${guest_os}" != "windows" ] || [ "${guest_os}" == "windows-server" ] && [ -n "${PUBLIC}" ]; then
|
# 9P
|
||||||
echo -n " - 9P: On guest: "
|
if [ "${guest_os}" != "windows" ] || [ "${guest_os}" == "windows-server" ]; then
|
||||||
if [ "${guest_os}" == "linux" ]; then
|
echo -n " - 9P: On guest: "
|
||||||
echo "sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 ${PUBLIC_TAG} ~/$(basename "${PUBLIC}")"
|
if [ "${guest_os}" == "linux" ]; then
|
||||||
elif [ "${guest_os}" == "macos" ]; then
|
echo "sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 ${PUBLIC_TAG} ~/$(basename "${PUBLIC}")"
|
||||||
# PUBLICSHARE needs to be world writeable for seamless integration with
|
elif [ "${guest_os}" == "macos" ]; then
|
||||||
# macOS. Test if it is world writeable, and prompt what to do if not.
|
# PUBLICSHARE needs to be world writeable for seamless integration with
|
||||||
echo "sudo mount_9p ${PUBLIC_TAG}"
|
# macOS. Test if it is world writeable, and prompt what to do if not.
|
||||||
if [ "${PUBLIC_PERMS}" != "drwxrwxrwx" ]; then
|
echo "sudo mount_9p ${PUBLIC_TAG}"
|
||||||
echo " - 9P: On host: chmod 777 ${PUBLIC}"
|
if [ "${PUBLIC_PERMS}" != "drwxrwxrwx" ]; then
|
||||||
echo " Required for macOS integration 👆"
|
echo " - 9P: On host: chmod 777 ${PUBLIC}"
|
||||||
|
echo " Required for macOS integration 👆"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# If smbd is available and ~/Public is present export it to the guest via samba
|
# SMB
|
||||||
if [[ -x "$(command -v smbd)" && -n ${PUBLIC} ]]; then
|
if [ -x "$(command -v smbd)" ]; then
|
||||||
NET+=",smb=${PUBLIC}"
|
NET+=",smb=${PUBLIC}"
|
||||||
echo " - smbd: On guest: smb://10.0.2.4/qemu"
|
echo " - smbd: On guest: smb://10.0.2.4/qemu"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue