mb-admin/scripts/relay/uninstall_relay.sh

27 lines
842 B
Bash
Raw Permalink Normal View History

2024-09-18 15:44:48 +00:00
#!/bin/bash
# Deactivate and uninstall Object Cache Pro from WordPress
cd /var/www/webroot/ROOT
wp plugin deactivate object-cache-pro
wp plugin uninstall object-cache-pro
# Optionally, if you want to re-enable LiteSpeed Cache settings
# wp litespeed-option set object 1 # Enables LiteSpeed Cache if it was disabled previously
# Path to the PHP extension directory and ini file for Relay
RELAY_INI_DIR=$(php-config --ini-dir)
RELAY_EXT_DIR=$(php-config --extension-dir)
RELAY_INI_FILE="$RELAY_INI_DIR/60-relay.ini"
RELAY_SO_FILE="$RELAY_EXT_DIR/relay.so"
# Remove the Relay configuration file and extension
sudo rm -f "$RELAY_INI_FILE"
sudo rm -f "$RELAY_SO_FILE"
# Restart the web server to apply changes
sudo service lsws restart
# Confirmation message
echo "Relay/Object Cache Pro and related configurations have been uninstalled."