#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# permissions
lsiown -R abc:abc \
    /var/lib/nginx \
    /var/tmp/nginx

lsiown -R abc:abc \
    /config/keys \
    /config/log \
    /config/nginx \
    /config/php

lsiown abc:abc \
    /config/www

chmod -R g+w \
    /config/nginx

chmod -R 644 /etc/logrotate.d

if [[ -f "/config/log/logrotate.status" ]]; then
    chmod 600 /config/log/logrotate.status
fi
