From 45c64faeec218f97b166f006094cd80052f9a026 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 24 Jun 2022 14:38:12 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20modified:=20files/run.s?= =?UTF-8?q?h=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/run.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/files/run.sh b/files/run.sh index e4ed7c0..3a1ae2d 100644 --- a/files/run.sh +++ b/files/run.sh @@ -21,6 +21,14 @@ else chown -R nginx:nginx /usr/html fi +if [ ! -d "/var/lib/mysql/mysql" ]; then + rm -Rf "/var/lib/mysql/" + /usr/bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql + mysqld_safe --datadir=/var/lib/mysql & + mysqladmin --silent --wait=30 ping || exit 1 + mysqladmin -u root password "$DB_PASS" +fi + mkdir -p /usr/logs/php8 mkdir -p /usr/logs/nginx mkdir -p /tmp/nginx @@ -29,7 +37,7 @@ chown -Rf nginx /tmp/nginx chown -Rf mysql:mysql /var/lib/mysql /run/mysqld /usr/bin/php-fpm & -mysqld_safe --datadir=/var/lib/mysql & +mysqladmin --silent --wait=30 ping || mysqld_safe --datadir=/var/lib/mysql & if [ ! -d "/var/lib/mysql/wordpress" ]; then sleep 10