Changeset 14162


Ignorieren:
Zeitstempel:
17.03.2017 21:05:30 (vor 3 Monaten)
Autor:
er13
Nachricht:

FreetzMount:

  • yet another attempt to address the issue reported in #2384 - replace all spaces with underscores
  • refs #2384
Datei:
1 bearbeitet

Legende:

Unverändert
Hinzugefügt
Entfernt
  • trunk/make/mod/files/root/usr/lib/libmodmount.sh

    r14161 r14162  
    2424    local mnt_name="" 
    2525 
    26     local storage_prefix="${MOD_STOR_PREFIX:-uStor}" 
     26    local storage_prefix=$(echo -n ${MOD_STOR_PREFIX})                  # trim leading, trailing, and multiple spaces in-between 
     27    storage_prefix=${storage_prefix:-uStor}                             # and ensure it's not empty 
     28 
    2729    local dev_idx=$(echo -n ${1:2} | tr '[a-j]' '[0-9]') 
    28     local part_idx=$2 
    29     [ $part_idx -gt 9 ] && part_idx=$(echo $((part_idx-10)) | tr "0-5" "A-F") # partition index in HEX 
     30    local part_idx=$(printf "%X" $2)                                    # partition index in HEX 
    3031 
    3132    if [ "$MOD_STOR_NAMING_SCHEME" == "PARTITION_LABEL" ]; then 
    3233        [ "$2" == "0" ] && local mnt_device="/dev/$1" || local mnt_device="/dev/$1$2" 
    3334        mnt_name="$(blkid $mnt_device | sed -rn 's!.*LABEL="([^"]*).*!\1!p')" 
    34         mnt_name=$(echo $mnt_name) # trim leading, trailing, and multiple spaces in-between 
     35        mnt_name=$(echo -n $mnt_name)                              # trim leading, trailing, and multiple spaces in-between 
    3536    elif [ "$MOD_STOR_NAMING_SCHEME" == "VENDOR_PRODUCT" ]; then 
    3637        # a slightly modified version of AVMs nicename from the 6.20 firmware series 
     
    4647    fi 
    4748 
    48     echo $mnt_name 
     49    echo -n ${mnt_name// /_}                                            # replace all spaces with underscores 
    4950} 
    5051 
Hinweis: Hilfe zur Verwendung der Changeset-Ansicht finden Sie unter TracChangeset.