summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc51
1 files changed, 37 insertions, 14 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc
index 3152b85d..30b75efa 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc
@@ -26,25 +26,48 @@ function already_mounted()
function mounter()
{
# Ausgabe: konnte mounten: 0, konnte nicht mounten: 1, schon gemountet 2
- already_mounted "$3"
+ already_mounted "$4"
ERR=$?
if [ "$ERR" -eq 0 ]; then
logger "openslx sharemapper: $3 already mounted."
AUSGANG=2
else
- AUSGANG=0
- x=2
- while ! mount $1 $2 $3 2>/dev/null 1>&2; do
- logger "openslx sharemapper: could not mount ${2} to ${3}, waited another $x seconds, retrying."
- sleep $x
- if [ "$x" -gt 6 ]; then
- AUSGANG=1
- logger "openslx sharemapper: timeout, could not mount ${2} to ${3}."
- break
- fi
- let x=x+2
- done
- [ "$AUSGANG" -eq 0 ] && logger "openslx sharemapper: ${2} mounted to ${3}." # Todo: Schöner schreiben:)
+ case "$MOUNTER" in
+ nfs) AUSGANG=0
+ x=2
+ while ! mount $1 $2 $3 $4 2>/dev/null 1>&2; do
+ logger "openslx sharemapper: could not mount ${3} to ${4}, waited another $x seconds, retrying."
+ sleep $x
+ if [ "$x" -gt 6 ]; then
+ AUSGANG=1
+ logger "openslx sharemapper: timeout, could not mount ${3} to ${4}."
+ break
+ fi
+ let x=x+2
+ done
+ [ "$AUSGANG" -eq 0 ] && logger "openslx sharemapper: ${3} mounted to ${4} (nfs)." # Todo: Schöner schreiben:)
+ ;;
+ cifs) AUSGANG=0
+ x=2
+ for VERSION in $CIFSVERSIONS; do
+ AUSGANG=0
+ while ! mount $1 vers="$VERSION",${2} $3 $4 2>/dev/null 1>&2; do
+ logger "openslx sharemapper: could not mount ${3} to ${4}, waited another $x seconds, retrying."
+ sleep $x
+ if [ "$x" -gt 4 ]; then
+ AUSGANG=1
+ logger "openslx sharemapper: timeout, could not mount ${3} to ${4} cifs v${VERSION}."
+ break
+ fi
+ let x=x+2
+ done
+ [ "$AUSGANG" -eq 0 ] && break
+ done
+ [ "$AUSGANG" -eq 0 ] && logger "openslx sharemapper: ${3} mounted to ${4} (cifs $VERSION)."
+ ;;
+ *) logger "openslx sharemapper: unknown mounter ${MOUNTER}!"
+ ;;
+ esac
fi
return $AUSGANG
}