From 421e30d36e37bd4bfcff99240f0a79e8c1370e3b Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 23 May 2014 14:45:42 +0200 Subject: [vmchooserX] SLX_VM_NFS can now be a CIFS-share --- .../data/opt/openslx/scripts/systemd-mount_vm_store | 14 +++++++++++++- .../data/opt/openslx/scripts/systemd-mount_vm_store | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-mount_vm_store b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-mount_vm_store index 831e25d8..31b08f67 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-mount_vm_store +++ b/remote/modules/vmchooser/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 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 -- cgit v1.2.3-55-g7522