Deleting history
This commit is contained in:
8
.env
Normal file
8
.env
Normal file
@@ -0,0 +1,8 @@
|
||||
#bdd
|
||||
dbuser=root
|
||||
dbpass=qUtjnFdebz24N5Xy
|
||||
|
||||
#wp
|
||||
admin_user=bruno
|
||||
admin_password=kpm97321
|
||||
admin_email="bruno@clicclac.info"
|
||||
21
README.md
Normal file
21
README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# wordpress
|
||||
|
||||
Some scripts related to Synology NAS.
|
||||
|
||||
|
||||
|
||||
#### 1) install_wp-cli.sh
|
||||
|
||||
Usage: ./install_wp-cli.sh
|
||||
|
||||
Download and install wp-cli to /usr/local/bin
|
||||
|
||||
|
||||
|
||||
#### 2) install_wp.sh
|
||||
|
||||
Usage: ./install_wp.sh
|
||||
|
||||
Download and install WordPress with wp-cli.
|
||||
|
||||
.env file required for credentials.
|
||||
13
install_wp-cli.sh
Normal file
13
install_wp-cli.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Télécharger
|
||||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||
|
||||
# Test
|
||||
php wp-cli.phar --info
|
||||
|
||||
chmod +x wp-cli.phar
|
||||
sudo mv wp-cli.phar /usr/local/bin/wp
|
||||
|
||||
# Test
|
||||
wp --info
|
||||
79
install_wp.sh
Executable file
79
install_wp.sh
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
red="\033[0;31m"
|
||||
redbold="\033[1;31m"
|
||||
green="\033[0;32m"
|
||||
greenbold="\033[1;32m"
|
||||
yellow="\033[0;33m"
|
||||
yellowbold="\033[1;33m"
|
||||
bold="\033[1m"
|
||||
italic="\033[3m"
|
||||
#bold_under="\033[1;4m"
|
||||
underline="\033[4m"
|
||||
reset="\033[0m"
|
||||
|
||||
#bdd
|
||||
dbhost=localhost
|
||||
dbuser=
|
||||
dbpass=
|
||||
dbname=wordpress
|
||||
dbprefix=wp_
|
||||
|
||||
#wp
|
||||
url=localhost
|
||||
title="My WordPress blog"
|
||||
admin_user=
|
||||
admin_password=
|
||||
admin_email=
|
||||
default_theme=twentyseven
|
||||
defaults_plugins="admin-post-navigation meow-lightbox"
|
||||
locale=fr_FR
|
||||
version=6.7.1
|
||||
|
||||
dotenv () {
|
||||
set -a
|
||||
# shellcheck disable=SC1091
|
||||
[ -f ".env" ] && . ".env" || { echo -e "${red}\nNo .env file found ! Needed: admin/pass for bdd, admin/pass/mail for wp.${reset}"; exit 1;}
|
||||
set +a
|
||||
}
|
||||
|
||||
dotenv
|
||||
|
||||
# Télécharger WordPress:
|
||||
$ wp core download --locale=$locale --version=$version
|
||||
|
||||
# Créer le fichier de config (wp-config.php):
|
||||
#$ wp config create --dbname=testdb --dbuser=wp --dbpass=yourpassword
|
||||
#$ wp core config --dbname=databasename --dbuser=databaseuser --dbpass=databasepassword --dbhost=localhost --dbprefix=prfx_
|
||||
|
||||
# Avec Des options supplémentaires:
|
||||
$ wp core config --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass --dbhost=$dbhost --dbprefix=$dbprefix --extra-php <<PHP
|
||||
define( 'WP_DEBUG', true );
|
||||
define( 'WP_DEBUG_LOG', true );
|
||||
PHP
|
||||
|
||||
# Créer la bdd 'wordpress4':
|
||||
$ wp db create
|
||||
|
||||
# Pour connaitre les encodages utilisés:
|
||||
#$ wp db cli
|
||||
#MariaDB [wordpress5]> SELECT @@character_set_database, @@collation_database;
|
||||
|
||||
# Installer WordPress:
|
||||
$ wp core install --url=$url --title=$title --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email
|
||||
|
||||
# Changement de la structure des liens pour ne conserver que le nom de l'article
|
||||
$ wp rewrite structure '/%postname%'
|
||||
|
||||
# Liste les thèmes trouvable dans l'installation
|
||||
$ wp theme list
|
||||
|
||||
# Installer un thème:
|
||||
$ wp theme install $default_theme
|
||||
|
||||
# Activer le thème:
|
||||
$ wp theme activate $default_theme
|
||||
|
||||
# Installer et activer les plugins:
|
||||
#$ wp plugin install admin-post-navigation jetpack meow-lightbox simple-tags sola-newsletters wp-retina-2x-pro wp-super-cache --activate
|
||||
$ wp plugin install $defaults_plugins --activate
|
||||
Reference in New Issue
Block a user