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
#
# - please use an "|" as delimiter
# - dont use spaces in sharenames, local mountpounts, usernames, passwords
# and options.
# - dont use spaces in usernames, passwords and options.
# - local mountpoints can be only on /storage and /media (not recommended!).
# - you can use any dir inside the XBMC home /storage/.xbmc/... for local
# 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/tv shows | /storage/mount/tvshows | username=user,password=secret

View File

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