Bladeren bron

Update install.sh

lj2007331 8 jaren geleden
bovenliggende
commit
1fbb2fe3b3
5 gewijzigde bestanden met toevoegingen van 25 en 25 verwijderingen
  1. 16 16
      addons.sh
  2. 1 1
      include/get_ipaddr_state.py
  3. 1 1
      include/ioncube.sh
  4. 6 6
      install.sh
  5. 1 1
      versions.txt

+ 16 - 16
addons.sh

@@ -50,8 +50,8 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 
 # Check PHP
 if [ -e "$php_install_dir/bin/phpize" ];then
-    PHP_version_detail=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
-    PHP_version=`echo $PHP_version_detail | awk -F. '{print $1"."$2}'`
+    PHP_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
+    PHP_main_version=${PHP_version%.*}
 fi
 
 # Check PHP Extensions
@@ -192,19 +192,19 @@ What Are You Doing?
                 else
                     if [ $PHP_cache = 1 ];then
                         cd $oneinstack_dir/src
-                        if [[ $PHP_version =~ ^5.[3-4]$ ]];then
+                        if [[ $PHP_main_version =~ ^5.[3-4]$ ]];then
                             Install_ZendOPcache
-                        elif [ "$PHP_version" == '5.5' ];then
+                        elif [ "$PHP_main_version" == '5.5' ];then
                             src_url=http://www.php.net/distributions/php-$php_5_version.tar.gz && Download_src
                             tar xzf php-$php_5_version.tar.gz
                             cd php-$php_5_version/ext/opcache
                             Install_opcache
-                        elif [ "$PHP_version" == '5.6' ];then
+                        elif [ "$PHP_main_version" == '5.6' ];then
                             src_url=http://www.php.net/distributions/php-$php_6_version.tar.gz && Download_src
                             tar xzf php-$php_6_version.tar.gz
                             cd php-$php_6_version/ext/opcache
                             Install_opcache
-                        elif [ "$PHP_version" == '7.0' ];then
+                        elif [ "$PHP_main_version" == '7.0' ];then
                             src_url=http://www.php.net/distributions/php-$php_7_version.tar.gz && Download_src
                             tar xzf php-$php_7_version.tar.gz
                             cd php-$php_7_version/ext/opcache
@@ -212,7 +212,7 @@ What Are You Doing?
                         fi
                         Check_succ
                     elif [ $PHP_cache = 2 ];then
-                        if [[ $PHP_version =~ ^5.[3-6]$ ]];then
+                        if [[ $PHP_main_version =~ ^5.[3-6]$ ]];then
                             while :; do
                                 read -p "Please input xcache admin password: " xcache_admin_pass
                                 (( ${#xcache_admin_pass} >= 5 )) && { xcache_admin_md5_pass=`echo -n "$xcache_admin_pass" | md5sum | awk '{print $1}'` ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
@@ -223,17 +223,17 @@ What Are You Doing?
                             echo "${CWARNING}Your php does not support XCache! ${CEND}"; exit 1
                         fi
                     elif [ $PHP_cache = 3 ];then
-                        if [[ $PHP_version =~ ^5.[3-5]$ ]];then
+                        if [[ $PHP_main_version =~ ^5.[3-5]$ ]];then
                             Install_APCU
                             Check_succ
                         else
                             echo "${CWARNING}Your php does not support APCU! ${CEND}"; exit 1
                         fi
                     elif [ $PHP_cache = 4 ];then
-                        if [ "$PHP_version" == '5.3' ];then
+                        if [ "$PHP_main_version" == '5.3' ];then
                             Install_eAccelerator-0-9
                             Check_succ
-                        elif [ "$PHP_version" == '5.4' ];then
+                        elif [ "$PHP_main_version" == '5.4' ];then
                             Install_eAccelerator-1-0-dev
                             Check_succ
                         else
@@ -257,13 +257,13 @@ What Are You Doing?
                     echo "${CWARNING}input error! Please only input number 1,2${CEND}"
                 else
                     [ $Loader = 1 ] && PHP_extension=ZendGuardLoader
-                    [ $Loader = 2 ] && PHP_extension=ioncube
+                    [ $Loader = 2 ] && PHP_extension=0ioncube
                     break
                 fi
             done
             if [ $ACTION = 1 ];then
                 Check_PHP_Extension
-                if [[ $PHP_version =~ ^5.[3-6]$ ]];then
+                if [[ $PHP_main_version =~ ^5.[3-6]$ ]];then
                     if [ $Loader = 1 ];then
                         if [ -e $php_install_dir/etc/php.d/ext-opcache.ini ];then
                             echo; echo "${CWARNING}You have to install OpCache, You need to uninstall it before install ZendGuardLoader! ${CEND}"; echo; exit 1
@@ -273,7 +273,7 @@ What Are You Doing?
                         fi
                     elif [ $Loader = 2 ];then
                         Install_ionCube
-                        Restart_PHP; echo "${CSUCCESS}PHP $PHP_extension module installed successfully! ${CEND}";
+                        Restart_PHP; echo "${CSUCCESS}PHP ioncube module installed successfully! ${CEND}";
                     fi
                 else
                     echo; echo "${CWARNING}Your php does not support $PHP_extension! ${CEND}";
@@ -321,9 +321,9 @@ What Are You Doing?
             if [ $ACTION = 1 ];then
                 Check_PHP_Extension
                 cd $oneinstack_dir/src
-                src_url=http://www.php.net/distributions/php-$PHP_version_detail.tar.gz && Download_src
-                tar xzf php-$PHP_version_detail.tar.gz
-                cd php-$PHP_version_detail/ext/fileinfo
+                src_url=http://www.php.net/distributions/php-$PHP_version.tar.gz && Download_src
+                tar xzf php-$PHP_version.tar.gz
+                cd php-$PHP_version/ext/fileinfo
                 $php_install_dir/bin/phpize
                 ./configure --with-php-config=$php_install_dir/bin/php-config
                 make -j ${THREAD} && make install

+ 1 - 1
include/get_ipaddr_state.py

@@ -12,4 +12,4 @@ try:
     else:
         print data
 except:
-    print "Usage:%s {country_id|isp} IP" % sys.argv[0]
+    print "Usage:%s {country_id|isp_id} IP" % sys.argv[0]

+ 1 - 1
include/ioncube.sh

@@ -40,7 +40,7 @@ else
 fi
 
 rm -rf ioncube
-cat > $php_install_dir/etc/php.d/ext-ioncube.ini << EOF
+cat > $php_install_dir/etc/php.d/ext-0ioncube.ini << EOF
 [ionCube Loader]
 zend_extension=$zend_extension
 EOF

+ 6 - 6
install.sh

@@ -31,12 +31,6 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 # Check if user is root
 [ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
-# get the IP information
-IPADDR=`./include/get_ipaddr.py`
-PUBLIC_IPADDR=`./include/get_public_ipaddr.py`
-IPADDR_COUNTRY=`./include/get_ipaddr_state.py country_id $PUBLIC_IPADDR`
-[ "`./include/get_ipaddr_state.py isp $PUBLIC_IPADDR`" == '\u963f\u91cc\u4e91' ] && IPADDR_ISP=aliyun
-
 mkdir -p $wwwroot_dir/default $wwwlogs_dir
 [ -d /data ] && chmod 755 /data
 
@@ -454,6 +448,12 @@ while :; do echo
     fi
 done
 
+# get the IP information
+PUBLIC_IPADDR=`./include/get_public_ipaddr.py`
+IPADDR_COUNTRY=`./include/get_ipaddr_state.py country_id $PUBLIC_IPADDR`
+IPADDR=`./include/get_ipaddr.py`
+[ "`./include/get_ipaddr_state.py isp_id $PUBLIC_IPADDR`"x == '1000323'x ] && IPADDR_ISP=aliyun
+
 # init
 . ./include/memory.sh
 if [ "$OS" == 'CentOS' ];then

+ 1 - 1
versions.txt

@@ -43,7 +43,7 @@ php_3_version=5.3.29
 zendopcache_version=7.0.5
 xcache_version=3.2.0
 apcu_version=4.0.10
-ImageMagick_version=6.9.5-2
+ImageMagick_version=6.9.5-3
 imagick_version=3.4.1
 GraphicsMagick_version=1.3.24
 gmagick_version=1.1.7RC3