summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules')
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/systemd-mount_vm_store15
1 files changed, 12 insertions, 3 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 0915169c..c15a9504 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,17 +2,26 @@
. /opt/openslx/config || exit 1
-[ -z "$SLX_VM_NFS" ] && slxlog "mount-vmstore" "No SLX_VM_NFS given in /opt/openslx/config!" && exit 1
+[ -z "$SLX_VM_NFS" ] && slxlog "mount-vmstore-config" "No SLX_VM_NFS given in /opt/openslx/config!" && exit 1
+[ "x${SLX_VM_NFS}" = "xdnbd3" ] && exit 0
# create target directory
mkdir -p /mnt/vmstore
# check if it is a CIFS-share or NFS-share
# no bash, so this is a bit ugly...
+TMP_LOG=$(mktemp)
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
+ mount -t nfs -o ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore > "${TEMP_LOG}"
+ RET=$?
else
# starts with '//' -> assume CIFS
- mount -t cifs -o guest,ro,file_mode=0644,dir_mode=0755 "$SLX_VM_NFS" /mnt/vmstore
+ mount -t cifs -o guest,ro,file_mode=0644,dir_mode=0755 "$SLX_VM_NFS" /mnt/vmstore > "${TEMP_LOG}"
+ RET=$?
+fi
+
+# check for errors
+if [ $RET -ne 0 ]; then
+ slxlog "mount-vmstore-exec" "Mount of '$SLX_VM_NFS' failed with '$RET'." "${TEMP_LOG}"
fi