#!/bin/bash # Declare variables. # CPU Type ARCH=`uname -m` # Server IP IP=`ifconfig eth0 | grep "inet addr" |cut -d ":" -f 2 | cut -d " " -f 1` # Find PHP version PHPV=`php -v |head -1 | awk {'print $2'} | cut -d "." -f 1-2` if [ $ARCH == "x86_64" ]; then echo "Downloading x86_64 loaders." wget -P /tmp http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz cd /usr/local && tar xzf /tmp/ioncube_loaders_lin_x86-64.tar.gz cp /usr/local/ioncube/ioncube-encoded-file.php /usr/local/apache/htdocs/ echo echo "Extraction complete. To activate the loader add the following line to /usr/local/lib/php.ini, before any other zend_extension lines. Then restart httpd" echo echo "zend_extension = /usr/local/ioncube/ioncube_loader_lin_$PHPV.so" echo echo "To test go to http://$IP/ioncube-encoded-file.php and verify that there are no errors." echo # Clean up rm -f ioncube_install.sh rm -f /tmp/ioncube_loaders_lin_x86-64.tar.gz exit 0 else echo "Downloading x86 loaders." wget -P /tmp http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz cd /usr/local && tar xzf /tmp/ioncube_loaders_lin_x86.tar.gz cp /usr/local/ioncube/ioncube-encoded-file.php /usr/local/apache/htdocs/ echo echo "Extraction complete. To activate the loader add the following line to /usr/local/lib/php.ini, before any other zend_extension lines. Then restart httpd" echo echo "zend_extension = /usr/local/ioncube/ioncube_loader_lin_$PHPV.so" echo echo "To test go to http://$IP/ioncube-encoded-file.php and verify that there are no errors." echo # Clean up rm -fv $0 rm -fv /tmp/ioncube_loaders_lin_x86.tar.gz exit 0 fi