Last active
August 29, 2015 14:20
-
-
Save freestream/12cd4a73af0040f3ad20 to your computer and use it in GitHub Desktop.
Lighttpd bash script to toggle between HHVM and php in a Ubuntu system.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Lighttpd bash script to toggle between HHVM and PHP. | |
# | |
# Place the file in a shared bin directory so the file can be executed as root | |
# ex. /usr/local/bin/toggle-hhvm | |
# | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
if [ -f /etc/lighttpd/conf-enabled/15-fastcgi-php.conf ]; then | |
lighty-disable-mod fastcgi-php | |
lighty-enable-mod fastcgi-hhvm | |
echo "########################" | |
echo "###### Using HHVM ######" | |
echo "########################" | |
else | |
lighty-disable-mod fastcgi-hhvm | |
lighty-enable-mod fastcgi-php | |
echo "########################" | |
echo "###### Using PHP #######" | |
echo "########################" | |
fi | |
service lighttpd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment