diff options
author | Jonathan Bauer | 2014-05-23 14:45:42 +0200 |
---|---|---|
committer | Jonathan Bauer | 2014-05-23 14:45:42 +0200 |
commit | 421e30d36e37bd4bfcff99240f0a79e8c1370e3b (patch) | |
tree | 16f9bf5e6b60e765a9e882b90b262559faad80a6 /remote | |
parent | [vmchooser] fix microphones in VMs (diff) | |
download | tm-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')
-rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/scripts/systemd-mount_vm_store | 14 | ||||
-rwxr-xr-x | remote/modules/vmchooser2/data/opt/openslx/scripts/systemd-mount_vm_store | 14 |
2 files changed, 26 insertions, 2 deletions
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 |