netmount: add loop until network is up, use 'mount' instead 'mount.cifs' to avoid problems with readonly '/etc/mtab' (mtab locking)

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-07-30 20:04:45 +02:00
parent 45843816fa
commit 70677c91fa

View File

@ -46,19 +46,19 @@ IFS="
mkdir -p $MOUNTPOINT
case "$SERVICE" in
cifs)
mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS"
;;
samba)
mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS"
;;
smb)
mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS"
cifs|smb|samba)
for i in 1 2 3 4 5 6 7 8 9 10; do
ERR_ENV=1
mount -n -t cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS" > /dev/null 2>&1
[ $? -eq 0 ] && ERR_ENV=0 && break
usleep 750000
done
;;
# nfs)
# mount.nfs $SHARE $MOUNTPOINT -o $OPTIONS
# ;;
esac
[ "$ERR_ENV" -ne 0 ] && echo "... could not mount $SHARE to $MOUNTPOINT"
done
fi
fi