Fix cache for Theme 2023

modified:   bin/container/appinstallctl.sh
This commit is contained in:
Cold-Egg
2022-12-06 15:51:48 +08:00
parent 1a6a67579a
commit 55b742ae33
+14 -3
View File
@@ -540,10 +540,21 @@ filetype[0] = '.aac
; <------------ CDN Mapping Example END ------------------>
EOM
if [ ! -f ${VH_DOC_ROOT}/wp-content/themes/${THEME}/functions.php.bk ]; then
cp ${VH_DOC_ROOT}/wp-content/themes/${THEME}/functions.php ${VH_DOC_ROOT}/wp-content/themes/${THEME}/functions.php.bk
THEME_PATH="${VH_DOC_ROOT}/wp-content/themes/${THEME}"
if [ ! -f ${THEME_PATH}/functions.php ]; then
cat >> "${THEME_PATH}/functions.php" <<END
<?php
require_once( WP_CONTENT_DIR.'/../wp-admin/includes/plugin.php' );
\$path = 'litespeed-cache/litespeed-cache.php' ;
if (!is_plugin_active( \$path )) {
activate_plugin( \$path ) ;
rename( __FILE__ . '.bk', __FILE__ );
}
END
elif [ ! -f ${THEME_PATH}/functions.php.bk ]; then
cp ${THEME_PATH}/functions.php ${THEME_PATH}/functions.php.bk
ck_ed
ed ${VH_DOC_ROOT}/wp-content/themes/${THEME}/functions.php << END >>/dev/null 2>&1
ed ${THEME_PATH}/functions.php << END >>/dev/null 2>&1
2i
require_once( WP_CONTENT_DIR.'/../wp-admin/includes/plugin.php' );
\$path = 'litespeed-cache/litespeed-cache.php' ;