mb-admin/scripts/relay/enable_relay.sh

18 lines
530 B
Bash
Raw Permalink Normal View History

2024-09-18 15:44:48 +00:00
#!/bin/bash
# Enable Relay in PHP configuration
RELAY_INI_FILE=$(php-config --ini-dir)/60-relay.ini
if [ -f "$RELAY_INI_FILE" ]; then
# Handle optional spaces around '=' and ensure only commented 'extension = relay.so' lines are uncommented
sed -i 's/^;\s*extension\s*=\s*relay.so/extension=relay.so/' $RELAY_INI_FILE
echo "Relay enabled in PHP configuration."
else
echo "Relay configuration file not found."
exit 1
fi
# Restart LiteSpeed server
sudo service lsws restart
echo "LiteSpeed server restarted."