added new bins, changed the regex for domain bins, added some dev bins

This commit is contained in:
lars-hagen
2019-12-27 19:42:37 +01:00
parent 1c37f3e514
commit 049f8f1e8c
8 changed files with 95 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/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
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 "$@"