mirror of
https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion
synced 2024-11-23 09:12:15 +01:00
Warn if volumes don't appear to be setup correctly
Assuming they're following a conventional setup, this will warn users that they likely didn't set their volumes up correctly. It's not an error though because they may have done something like mount the entire /etc/nginx directory.
This commit is contained in:
parent
bc32889e37
commit
fa2a85c60d
@ -42,6 +42,10 @@ function get_nginx_proxy_cid {
|
||||
|
||||
function check_writable_directory {
|
||||
local dir="$1"
|
||||
docker_api "/containers/$HOSTNAME/json" | jq ".Mounts[].Destination" | grep -q "^\"$dir\"$"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Warning: '$dir' does not appear to be a mounted volume."
|
||||
fi
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
echo "Error: can't access to '$dir' directory !" >&2
|
||||
echo "Check that '$dir' directory is declared has a writable volume." >&2
|
||||
|
Loading…
Reference in New Issue
Block a user