From 62f443ab2a81c3cb966d0841063d881bb4846ab9 Mon Sep 17 00:00:00 2001 From: David Noyes Date: Wed, 11 Oct 2017 21:56:12 +0100 Subject: [PATCH] Adding whitespace around = in global config options parse --- samba.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samba.sh b/samba.sh index 99e2db6..1545d7d 100755 --- a/samba.sh +++ b/samba.sh @@ -37,7 +37,7 @@ charmap() { local chars="$1" file=/etc/samba/smb.conf # Arguments: # option) raw option # Return: line added to smb.conf (replaces existing line with same key) -global() { local key="${1%%=*}" value="${1##*=}" file=/etc/samba/smb.conf +global() { local key="${1%% = *}" value="${1##* = }" file=/etc/samba/smb.conf if grep -qE '^\s*'"$key" "$file"; then sed -i 's|^\s*'"$key"'.*| '"$key = $value"'|' "$file" else @@ -253,4 +253,4 @@ elif ps -ef | egrep -v grep | grep -q smbd; then else [[ ${NMBD:-""} ]] && ionice -c 3 nmbd -D exec ionice -c 3 smbd -FS