From 38a1faae48469d832f2e92067ca62f8379028764 Mon Sep 17 00:00:00 2001 From: Jakob Olsson Date: Fri, 22 Feb 2019 09:06:26 +0100 Subject: [PATCH] Revert "samba: prevent mulitple lines from being written to an option in smb.conf" This reverts commit 88291c196a4bba84429a7dd72444af80cd3c337e. --- samba3/files/samba.init | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/samba3/files/samba.init b/samba3/files/samba.init index 2dd51cb5a..887593e2b 100755 --- a/samba3/files/samba.init +++ b/samba3/files/samba.init @@ -80,12 +80,6 @@ smb_header() { config_get description $1 description "Samba on ${hostname:-OpenWrt}" config_get charset $1 charset "UTF-8" - name=`echo -e "$name" | head -1` - workgroup=`echo -e "$workgroup" | head -1` - description=`echo -e "$description" | head -1` - interfaces=`echo -e "$interfaces" | head -1` - charset=`echo -e "$charset" | head -1` - mkdir -p /var/etc sed -e "s#|NAME|#$name#g" \ -e "s#|WORKGROUP|#$workgroup#g" \ @@ -144,13 +138,13 @@ smb_add_share() { path=$(readlink -f $path) [ "${path:0:4}" == "/mnt" ] || path="/mnt/" - echo -e "\n[$name]\n\tpath = ${path%%\\n*}" >> /var/etc/smb.conf - [ -n "$users" ] && echo -e "\tvalid users = $users" | head -1 >> /var/etc/smb.conf - [ -n "$read_only" ] && echo -e "\tread only = $read_only" | head -1 >> /var/etc/smb.conf - [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" | head -1 >> /var/etc/smb.conf - [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" | head -1 >> /var/etc/smb.conf - [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" | head -1 >> /var/etc/smb.conf - [ -n "$browseable" ] && echo -e "\tbrowseable = $browseable" | head -1 >> /var/etc/smb.conf + echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf + [ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf + [ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /var/etc/smb.conf + [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf + [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf + [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf + [ -n "$browseable" ] && echo -e "\tbrowseable = $browseable" >> /var/etc/smb.conf } start_service() {