Skip to content

Commit

Permalink
v158
Browse files Browse the repository at this point in the history
+ DietPi-Config | NAS: Resolved an issue where samba client share names,
which contained spaces, would cause the mount the fail:
https://github.com/Fourdee/DietPi/issues/1201
  • Loading branch information
Fourdee committed Oct 26, 2017
1 parent 1bcb91b commit 66f982d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DietPi-Software | Gitea: Now available for installation. Many thanks to @techdab
DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210

Bug Fixes:
DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201
DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'.

Allo Web Interface Changes:
Expand Down
6 changes: 3 additions & 3 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -4754,9 +4754,9 @@ _EOF_
if (( $(df -h | grep -ci -m1 '/mnt/samba') == 1 )); then

#Get stats
sambaclient_mounted_size=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $2 }')
sambaclient_mounted_used=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $3 }')
sambaclient_mounted_free=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $4 }')
sambaclient_mounted_size=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-4)}')
sambaclient_mounted_used=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-3)}')
sambaclient_mounted_free=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-2)}')
sambaclient_status="/mnt/samba | Size $sambaclient_mounted_size | Used $sambaclient_mounted_used | Free $sambaclient_mounted_free"

fi
Expand Down
5 changes: 4 additions & 1 deletion dietpi/func/dietpi-set_smbclient
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@

Apply_And_Mount(){

#NB: Convert spaces into '\040': https://github.com/Fourdee/DietPi/issues/1201#issuecomment-339720271
local space_to_040=$(echo -e "$samba_clientshare" | sed 's/ /\\\\040/g')

#Apply to fstab
sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nofail 0 0" /etc/fstab
sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$space_to_040 \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nofail 0 0" /etc/fstab

#Mount up
mount -a
Expand Down

0 comments on commit 66f982d

Please sign in to comment.