netmount: add support for whitespaces in shares and folders, thanks much to Wintemrute

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-10-23 19:50:01 +02:00
parent 536858cb0a
commit 070810b797
2 changed files with 8 additions and 8 deletions

View File

@ -8,12 +8,11 @@
# service | share on server | local mountpoint | mount options # service | share on server | local mountpoint | mount options
# #
# - please use an "|" as delimiter # - please use an "|" as delimiter
# - dont use spaces in sharenames, local mountpounts, usernames, passwords # - dont use spaces in usernames, passwords and options.
# and options.
# - local mountpoints can be only on /storage and /media (not recommended!). # - local mountpoints can be only on /storage and /media (not recommended!).
# - you can use any dir inside the XBMC home /storage/.xbmc/... for local # - you can use any dir inside the XBMC home /storage/.xbmc/... for local
# mountpoints if you need this for some reasons. # mountpoints if you need this for some reasons.
# #
# Example: # Examples:
# cifs | //192.168.1.44/videos | /storage/mount/videos | username=user,password=secret # cifs | //192.168.1.44/videos | /storage/mount/videos | username=user,password=secret
# cifs | //192.168.1.44/tv shows | /storage/mount/tvshows | username=user,password=secret

View File

@ -37,10 +37,11 @@
IFS=" IFS="
" "
for i in `cat $NETMOUNT_USERCONF |grep -v "^#"`; do for i in `cat $NETMOUNT_USERCONF |grep -v "^#"`; do
SERVICE=`echo $i | sed -e "s@ @@g" | cut -f1 -d "|"` SERVICE=`echo $i | awk -F\| '{print $1}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
SHARE=`echo $i | sed -e "s@ @@g" | cut -f2 -d "|"` SHARE=`echo $i | awk -F\| '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
MOUNTPOINT=`echo $i | sed -e "s@ @@g" | cut -f3 -d "|"` MOUNTPOINT=`echo $i | awk -F\| '{print $3}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
OPTIONS=`echo $i | sed -e "s@ @@g" | cut -f4 -d "|"` OPTIONS=`echo $i | awk -F\| '{print $4}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
progress "... mounting $SHARE to $MOUNTPOINT ..." progress "... mounting $SHARE to $MOUNTPOINT ..."