diff options
Diffstat (limited to 'remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store')
-rwxr-xr-x | remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store | 14 |
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 |