Line 136
Link Here
|
|
|
136 |
samba_server_defaultyes() |
137 |
{ |
138 |
load_rc_config $1 |
139 |
eval ${1}_enable=\${${1}_enable-YES} |
140 |
if checkyesno ${1}_enable; then |
141 |
samba_daemons="$samba_daemons $1" |
142 |
fi |
143 |
} |
144 |
|
Line 137
Link Here
|
137 |
local name |
|
|
Line 150
Link Here
|
150 |
samba_daemons="samba" |
158 |
samba_server_defaultyes "samba" |
151 |
-- |
|
|
Lines 153-167
Link Here
|
153 |
samba_daemons="nmbd smbd winbindd" |
161 |
samba_server_defaultyes "nmbd" |
154 |
;; |
162 |
samba_server_defaultyes "smbd" |
155 |
esac |
163 |
# Winbindd will be active if it's set to "YES" in rc.conf |
156 |
# Load daemons configuration |
164 |
# or if 'idmap id' is defined in smb4.conf |
157 |
for name in ${samba_daemons}; do |
165 |
load_rc_config "winbindd" |
158 |
load_rc_config "${name}" |
166 |
samba_server_idmap=$(${testparm_command} --parameter-name='idmap uid' 2>/dev/null) |
159 |
# If samba_server_enable is 'YES' |
167 |
if [ -n "${samba_server_idmap}" ]; then |
160 |
if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then |
|
|
161 |
if [ "${name}" != "winbindd" ]; then |
162 |
# Set variable to 'YES' only if it is unset |
163 |
eval ${name}_enable=\${${name}_enable-YES} |
164 |
else |
165 |
# Winbindd |
166 |
samba_server_idmap=$(${testparm_command} --parameter-name='idmap uid' 2>/dev/null) |
167 |
if [ -n "${samba_server_idmap}" ]; then |
168 |
-- |
Line 169
Link Here
|
169 |
fi |
|
|
Lines 171-174
Link Here
|
171 |
fi |
170 |
if [ -n "$winbindd_enable" ] && checkyesno winbindd_enable; then |
172 |
# If variable is empty, set it to 'NO' |
171 |
samba_daemons="${samba_daemons} winbindd" |
173 |
eval ${name}_enable=\${${name}_enable:-NO} |
172 |
fi |
174 |
done |
173 |
;; |
175 |
-- |
174 |
esac |