18 lines
530 B
Bash
18 lines
530 B
Bash
|
#!/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."
|