Change user run
parent
e4faf53732
commit
d31d09fd79
|
@ -753,7 +753,7 @@ actions:
|
||||||
message: "${response.out}"
|
message: "${response.out}"
|
||||||
litespeed_metrics:
|
litespeed_metrics:
|
||||||
- cmd[cp]:
|
- cmd[cp]:
|
||||||
user: root
|
user: litespeed
|
||||||
commands:
|
commands:
|
||||||
- bash /home/litespeed/mbmanager/scripts/litespeed_metrics.sh
|
- bash /home/litespeed/mbmanager/scripts/litespeed_metrics.sh
|
||||||
- return:
|
- return:
|
||||||
|
|
|
@ -3,15 +3,20 @@
|
||||||
# LiteSpeed Cache Critical Metrics Monitor
|
# LiteSpeed Cache Critical Metrics Monitor
|
||||||
# Captures the 4 most important performance metrics
|
# Captures the 4 most important performance metrics
|
||||||
|
|
||||||
# Check if WP-CLI is available
|
# Find WP-CLI location
|
||||||
if [ ! -f "/home/litespeed/bin/wp" ]; then
|
WP_CLI_PATH=""
|
||||||
echo '{"error": "WP-CLI not found at /home/litespeed/bin/wp"}'
|
if [ -f "/home/litespeed/bin/wp" ]; then
|
||||||
|
WP_CLI_PATH="/home/litespeed/bin/wp"
|
||||||
|
elif command -v wp >/dev/null 2>&1; then
|
||||||
|
WP_CLI_PATH="wp"
|
||||||
|
else
|
||||||
|
echo '{"error": "WP-CLI not found. Please ensure WP-CLI is installed and accessible."}'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to run WP-CLI commands
|
# Function to run WP-CLI commands
|
||||||
run_wp_command() {
|
run_wp_command() {
|
||||||
/home/litespeed/bin/wp --path=/var/www/webroot/ROOT "$@" 2>/dev/null
|
$WP_CLI_PATH --path=/var/www/webroot/ROOT "$@" 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize JSON output
|
# Initialize JSON output
|
||||||
|
|
Loading…
Reference in New Issue