mirror of
https://github.com/Ladebeze66/Inception.git
synced 2026-11-09 13:47:09 +01:00
modif3
This commit is contained in:
@@ -1,29 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Attendre que MariaDB soit prêt à accepter des connexions
|
||||
echo "Waiting for MariaDB to be ready..."
|
||||
sleep 10
|
||||
|
||||
# Créer le répertoire pour le PID de PHP-FPM et définir les permissions
|
||||
mkdir -p /run/php
|
||||
chown www-data:www-data /run/php
|
||||
|
||||
# Télécharger WP-CLI si nécessaire
|
||||
if [ ! -f /usr/local/bin/wp ]; then
|
||||
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||
chmod +x wp-cli.phar
|
||||
mv wp-cli.phar /usr/local/bin/wp
|
||||
fi
|
||||
|
||||
# Télécharger et extraire WordPress
|
||||
if [ ! -f /var/www/html/wp-config.php ]; then
|
||||
wget https://fr.wordpress.org/wordpress-6.0-fr_FR.tar.gz -O /tmp/wordpress.tar.gz
|
||||
tar -xzvf /tmp/wordpress.tar.gz -C /var/www/html --strip-components=1
|
||||
chown -R www-data:www-data /var/www/html
|
||||
chmod -R 755 /var/www/html
|
||||
chmod -R 777 /var/www/html
|
||||
fi
|
||||
|
||||
# Installer WordPress
|
||||
if ! $(wp core is-installed --path='/var/www/html' --allow-root); then
|
||||
wp core install --url=${DOMAIN_NAME} --title=${WP_TITLE} --admin_user=${WP_ADMIN_USR} --admin_password=${WP_ADMIN_PWD} --admin_email=${WP_ADMIN_EMAIL} --path='/var/www/html' --allow-root
|
||||
echo "=== WordPress installed ==="
|
||||
# Créer un utilisateur supplémentaire
|
||||
wp user create ${WP_USR} ${WP_EMAIL} --user_pass=${WP_PWD} --role=subscriber --path='/var/www/html' --allow-root
|
||||
echo "=== User ${WP_USR} created ==="
|
||||
else
|
||||
echo "=== WordPress is already installed ==="
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user