summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmchooser2
diff options
context:
space:
mode:
authorJonathan Bauer2014-05-23 14:45:42 +0200
committerJonathan Bauer2014-05-23 14:45:42 +0200
commit421e30d36e37bd4bfcff99240f0a79e8c1370e3b (patch)
tree16f9bf5e6b60e765a9e882b90b262559faad80a6 /remote/modules/vmchooser2
parent[vmchooser] fix microphones in VMs (diff)
downloadtm-scripts-421e30d36e37bd4bfcff99240f0a79e8c1370e3b.tar.gz
tm-scripts-421e30d36e37bd4bfcff99240f0a79e8c1370e3b.tar.xz
tm-scripts-421e30d36e37bd4bfcff99240f0a79e8c1370e3b.zip
[vmchooserX] SLX_VM_NFS can now be a CIFS-share
Diffstat (limited to 'remote/modules/vmchooser2')
-rwxr-xr-xremote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store14
1 files changed, 13 insertions, 1 deletions
diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store b/remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store
index 831e25d8..31b08f67 100755
--- a/remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store
+++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store
@@ -2,5 +2,17 @@
. /opt/openslx/config || exit 1
+[ -z "$SLX_VM_NFS" ] && slxlog "mount-vmstore" "No SLX_VM_NFS given in /opt/openslx/config!" && exit 1
+
+# create target directory
mkdir -p /mnt/vmstore
-mount -t nfs -o ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore
+
+# check if it is a CIFS-share or NFS-share
+# no bash, so this is a bit ugly...
+if [ "${SLX_VM_NFS#//}" = "${SLX_VM_NFS}" ]; then
+ # doesn't start with '//' -> assume NFS
+ mount -t nfs -o ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore
+else
+ # starts with '//' -> assume CIFS
+ mount -t cifs -o guest,ro "$SLX_VM_NFS" /mnt/vmstore
+fi