From 2dc461f9462cbb6ba99741e02ed35dafd940231a Mon Sep 17 00:00:00 2001 From: matbgn Date: Wed, 18 May 2022 22:31:58 +0200 Subject: [PATCH] Add missing files from aurel-g solution --- cmd.sh | 20 ++++++++++++++++++++ init_content.sh | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 cmd.sh create mode 100644 init_content.sh diff --git a/cmd.sh b/cmd.sh new file mode 100644 index 0000000..e1f2b3d --- /dev/null +++ b/cmd.sh @@ -0,0 +1,20 @@ +#!/bin/bash +find /var/www/html/content -maxdepth 0 -empty -exec /init_content.sh \; +if [ "$TYPEMILL_UID" ] || [ "$TYPEMILL_GID" ]; then + usermod -u $TYPEMILL_UID www-data + groupmod -g $TYPEMILL_GID www-data + chown -R www-data:www-data /var/www/html +fi +chown -R www-data:www-data /var/www/html/cache +find /var/www/html/cache -type d -exec chmod 770 {} \; +find /var/www/html/cache -type f -exec chmod 660 {} \; +chown -R www-data:www-data /var/www/html/content +find /var/www/html/content -type d -exec chmod 770 {} \; +find /var/www/html/content -type f -exec chmod 660 {} \; +chown -R www-data:www-data /var/www/html/media +find /var/www/html/media -type d -exec chmod 770 {} \; +find /var/www/html/media -type f -exec chmod 660 {} \; +chown -R www-data:www-data /var/www/html/settings +find /var/www/html/settings -type d -exec chmod 770 {} \; +find /var/www/html/settings -type f -exec chmod 660 {} \; +apache2-foreground diff --git a/init_content.sh b/init_content.sh new file mode 100644 index 0000000..f17a5a3 --- /dev/null +++ b/init_content.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo "**************************************************************************" +echo "! Content directory is empty. It will be initialized with default content." +echo "**************************************************************************" +cp -R /var/www/html/content.orig/* /var/www/html/content/