You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cid="${cid%:*}"# Remove leading :ro or :rw set by remote docker-compose (thx anoopr)
233
-
if [[ $(docker_api "/containers/$cid/json"| jq -r '.Config.Env[]'|egrep -c '^NGINX_VERSION=')="1" ]];then
239
+
if [[ $(docker_api "/containers/$cid/json"| jq -r '.Config.Env[]'|grep -c -E'^NGINX_VERSION=')="1" ]];then
234
240
nginx_cid="$cid"
235
241
break
236
242
fi
@@ -244,8 +250,8 @@ function get_nginx_proxy_container {
244
250
245
251
## Nginx
246
252
functionreload_nginx {
247
-
local _docker_gen_container=$(get_docker_gen_container)
248
-
local _nginx_proxy_container=$(get_nginx_proxy_container)
253
+
local _docker_gen_container; _docker_gen_container=$(get_docker_gen_container)
254
+
local _nginx_proxy_container; _nginx_proxy_container=$(get_nginx_proxy_container)
249
255
250
256
if [[ -n"${_docker_gen_container:-}" ]];then
251
257
# Using docker-gen and nginx in separate container
@@ -285,16 +291,16 @@ function set_ownership_and_permissions {
285
291
return 1
286
292
fi
287
293
288
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: checking $path ownership and permissions."
294
+
[[ "$DEBUG"==true ]] &&echo"Debug: checking $path ownership and permissions."
289
295
290
296
# Find the user numeric ID if the FILES_UID environment variable isn't numeric.
291
297
if [[ "$user"=~ ^[0-9]+$ ]];then
292
298
user_num="$user"
293
299
# Check if this user exist inside the container
294
300
elif id -u "$user"> /dev/null 2>&1;then
295
301
# Convert the user name to numeric ID
296
-
local user_num="$(id -u "$user")"
297
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: numeric ID of user $user is $user_num."
302
+
local user_num; user_num="$(id -u "$user")"
303
+
[[ "$DEBUG"==true ]] &&echo"Debug: numeric ID of user $user is $user_num."
298
304
else
299
305
echo"Warning: user $user not found in the container, please use a numeric user ID instead of a user name. Skipping ownership and permissions check."
300
306
return 1
@@ -306,8 +312,8 @@ function set_ownership_and_permissions {
306
312
# Check if this group exist inside the container
307
313
elif getent group "$group"> /dev/null 2>&1;then
308
314
# Convert the group name to numeric ID
309
-
local group_num="$(getent group "$group"| awk -F ':''{print $3}')"
310
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: numeric ID of group $group is $group_num."
315
+
local group_num; group_num="$(getent group "$group"| awk -F ':''{print $3}')"
316
+
[[ "$DEBUG"==true ]] &&echo"Debug: numeric ID of group $group is $group_num."
311
317
else
312
318
echo"Warning: group $group not found in the container, please use a numeric group ID instead of a group name. Skipping ownership and permissions check."
313
319
return 1
@@ -316,7 +322,7 @@ function set_ownership_and_permissions {
316
322
# Check and modify ownership if required.
317
323
if [[ -e"$path" ]];then
318
324
if [[ "$(stat -c %u:%g "$path")"!="$user_num:$group_num" ]];then
319
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: setting $path ownership to $user:$group."
325
+
[[ "$DEBUG"==true ]] &&echo"Debug: setting $path ownership to $user:$group."
320
326
if [[ -L"$path" ]];then
321
327
chown -h "$user_num:$group_num""$path"
322
328
else
@@ -326,21 +332,21 @@ function set_ownership_and_permissions {
326
332
# If the path is a folder, check and modify permissions if required.
327
333
if [[ -d"$path" ]];then
328
334
if [[ "$(stat -c %a "$path")"!="$d_perms" ]];then
329
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: setting $path permissions to $d_perms."
335
+
[[ "$DEBUG"==true ]] &&echo"Debug: setting $path permissions to $d_perms."
330
336
chmod "$d_perms""$path"
331
337
fi
332
338
# If the path is a file, check and modify permissions if required.
333
339
elif [[ -f"$path" ]];then
334
340
# Use different permissions for private files (private keys and ACME account files) ...
335
341
if [[ "$path"=~ ^.*(default\.key|key\.pem|\.json)$ ]];then
336
342
if [[ "$(stat -c %a "$path")"!="$f_perms" ]];then
337
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: setting $path permissions to $f_perms."
343
+
[[ "$DEBUG"==true ]] &&echo"Debug: setting $path permissions to $f_perms."
338
344
chmod "$f_perms""$path"
339
345
fi
340
346
# ... and for public files (certificates, chains, fullchains, DH parameters).
341
347
else
342
348
if [[ "$(stat -c %a "$path")"!="644" ]];then
343
-
[[ "$(lc $DEBUG)"==true ]] &&echo"Debug: setting $path permissions to 644."
349
+
[[ "$DEBUG"==true ]] &&echo"Debug: setting $path permissions to 644."
344
350
chmod "644""$path"
345
351
fi
346
352
fi
@@ -350,8 +356,3 @@ function set_ownership_and_permissions {
0 commit comments