parent
049f8f1e8c
commit
ce78eb3a49
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Missing arguments, exit"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd /var/www/vhosts/$1/html
|
||||
if [ ! -f "./wp-config.php" ]; then
|
||||
# su -s /bin/bash www-data -c
|
||||
COUNTER=0
|
||||
until [ "$(curl -v mysql:3306 2>&1 | grep native)" ];
|
||||
do
|
||||
echo "Counter: ${COUNTER}"
|
||||
COUNTER=$((COUNTER+1))
|
||||
if [ ${COUNTER} = 10 ]; then
|
||||
echo '--- MySQL is starting, please wait... ---'
|
||||
elif [ ${COUNTER} = 100 ]; then
|
||||
echo '--- MySQL is timeout, exit! ---'
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
wp core download \
|
||||
--allow-root \
|
||||
--force
|
||||
first_www_uid=$(stat -c "%u" /var/www/vhosts/$1)
|
||||
first_www_gid=$(stat -c "%g" /var/www/vhosts/$1)
|
||||
chown $first_www_uid:$first_www_gid /var/www/vhosts/$1 -R
|
||||
|
||||
fi
|
||||
|
||||
|
||||
www_uid=$(stat -c "%u" /var/www/vhosts/$1)
|
||||
if [ ${www_uid} -eq 0 ]; then
|
||||
#echo "./sites/localhost is owned by root, auto changing ownership of ./sites/localhost to uid 1000"
|
||||
chown 1000:1000 /var/www/vhosts/localhost -R
|
||||
fi
|
||||
|
||||
#echo "WordPress installation finished."
|
||||
#exec "$@"
|
||||
|
@ -1,36 +1,4 @@
|
||||
#!/bin/bash
|
||||
cd /var/www/vhosts/$1/html
|
||||
if [ ! -f "./wp-config.php" ]; then
|
||||
# su -s /bin/bash www-data -c
|
||||
COUNTER=0
|
||||
until [ "$(curl -v mysql:3306 2>&1 | grep native)" ];
|
||||
do
|
||||
echo "Counter: ${COUNTER}"
|
||||
COUNTER=$((COUNTER+1))
|
||||
if [ ${COUNTER} = 10 ]; then
|
||||
echo '--- MySQL is starting, please wait... ---'
|
||||
elif [ ${COUNTER} = 100 ]; then
|
||||
echo '--- MySQL is timeout, exit! ---'
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
wp core download \
|
||||
--allow-root \
|
||||
--force
|
||||
first_www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
|
||||
first_www_gid=$(stat -c "%g" /var/www/vhosts/localhost)
|
||||
chown $first_www_uid:$first_www_gid /var/www/vhosts/localhost -R
|
||||
#!/usr/bin/env bash
|
||||
|
||||
fi
|
||||
|
||||
|
||||
www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
|
||||
if [ ${www_uid} -eq 0 ]; then
|
||||
#echo "./sites/localhost is owned by root, auto changing ownership of ./sites/localhost to uid 1000"
|
||||
chown 1000:1000 /var/www/vhosts/localhost -R
|
||||
fi
|
||||
|
||||
echo "WordPress installation finished."
|
||||
exec "$@"
|
||||
docker-compose exec litespeed su -c "downloadWPCtl.sh $1"
|
||||
|
||||
|
Loading…
Reference in new issue