1
0

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:
ryneeverett 2016-08-17 22:16:00 -04:00
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