sh WordPress WP-CLI安装脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh WordPress WP-CLI安装脚本相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env sh

set -e

[ -d wp-admin ] || wp core download

[ -f wp-config.php ] || wp config create \
    --dbhost="$WP_DB_HOST" \
    --dbname="$WP_DB_NAME" \
    --dbuser="$WP_DB_USER" \
    --dbpass="$WP_DB_PASSWORD"
    
if ! wp core is-installed
then
    gunzip -c /tmp/db.sql.gz > /tmp/db.sql
    wp db import /tmp/db.sql
    rm /tmp/db.sql
    
    # wp core install \
    #     --url="$WP_SITE_URL" \
    #     --title="$WP_SITE_TITLE" \
    #     --admin_user="$WP_ADMIN_USER" \
    #     --admin_password="$WP_ADMIN_PASSWORD" \
    #     --admin_email="$WP_ADMIN_EMAIL" \
    #     --skip-email
    # wp option update blogdescription "$WP_SITE_DESCRIPTION"
    # wp theme delete twentysixteen twentyseventeen twentynineteen
    # wp user update admin --user_pass=123
    # wp plugin delete akismet hello
    # wp plugin install --activate --force \
    #     advanced-custom-fields \
    #     jwt-authentication-for-wp-rest-api \
    #     /var/www/plugins/*.zip
    # wp import /var/www/content.wordpress.xml --authors=skip
    
    wp theme activate "jr"
fi

以上是关于sh WordPress WP-CLI安装脚本的主要内容,如果未能解决你的问题,请参考以下文章