samba.sh fix #76

This commit is contained in:
David Personette 2017-10-12 11:28:34 -04:00
parent e0631f472b
commit f76146635c

View File

@ -37,7 +37,7 @@ charmap() { local chars="$1" file=/etc/samba/smb.conf
# Arguments: # Arguments:
# option) raw option # option) raw option
# Return: line added to smb.conf (replaces existing line with same key) # 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 if grep -qE '^\s*'"$key" "$file"; then
sed -i 's|^\s*'"$key"'.*| '"$key = $value"'|' "$file" sed -i 's|^\s*'"$key"'.*| '"$key = $value"'|' "$file"
else else