mb-admin/scripts/relay/disable_relay.sh

19 lines
521 B
Bash

#!/bin/bash
# Disable Relay in PHP configuration
RELAY_INI_FILE=$(php-config --ini-dir)/60-relay.ini
if [ -f "$RELAY_INI_FILE" ]; then
# Ensure only uncommented 'extension = relay.so' lines are commented out
# Handle optional spaces around '='
sed -i '/^extension\s*=\s*relay.so/ s/^/;/' $RELAY_INI_FILE
echo "Relay disabled in PHP configuration."
else
echo "Relay configuration file not found."
exit 1
fi
# Restart LiteSpeed server
sudo service lsws restart
echo "LiteSpeed server restarted."