Browse Source

format oneinstack

lj2007331@gmail.com 6 years ago
parent
commit
2f7b1f3338
76 changed files with 181 additions and 177 deletions
  1. 4 4
      addons.sh
  2. 1 1
      include/GraphicsMagick.sh
  3. 1 1
      include/ImageMagick.sh
  4. 1 1
      include/ZendGuardLoader.sh
  5. 3 3
      include/alisql-5.6.sh
  6. 3 3
      include/apache-2.2.sh
  7. 3 3
      include/apache-2.4.sh
  8. 1 1
      include/apcu.sh
  9. 1 1
      include/check_dir.sh
  10. 3 3
      include/check_download.sh
  11. 11 7
      include/check_os.sh
  12. 3 3
      include/check_sw.sh
  13. 1 1
      include/color.sh
  14. 1 1
      include/demo.sh
  15. 1 1
      include/download.sh
  16. 1 1
      include/eaccelerator.sh
  17. 1 1
      include/get_char.sh
  18. 1 1
      include/hhvm_CentOS.sh
  19. 1 1
      include/init_CentOS.sh
  20. 1 1
      include/init_Debian.sh
  21. 1 1
      include/init_Ubuntu.sh
  22. 1 1
      include/ioncube.sh
  23. 2 2
      include/jdk-1.6.sh
  24. 2 2
      include/jdk-1.7.sh
  25. 2 2
      include/jdk-1.8.sh
  26. 2 2
      include/jdk-10.sh
  27. 1 1
      include/jemalloc.sh
  28. 3 3
      include/mariadb-10.0.sh
  29. 3 3
      include/mariadb-10.1.sh
  30. 3 3
      include/mariadb-10.2.sh
  31. 3 3
      include/mariadb-10.3.sh
  32. 3 3
      include/mariadb-5.5.sh
  33. 6 6
      include/memcached.sh
  34. 1 1
      include/memory.sh
  35. 3 3
      include/mongodb.sh
  36. 3 3
      include/mysql-5.5.sh
  37. 3 3
      include/mysql-5.6.sh
  38. 3 3
      include/mysql-5.7.sh
  39. 3 3
      include/mysql-8.0.sh
  40. 3 3
      include/nginx.sh
  41. 1 1
      include/ngx_lua_waf.sh
  42. 3 3
      include/openresty.sh
  43. 1 1
      include/openssl.sh
  44. 1 1
      include/pecl_mongodb.sh
  45. 1 1
      include/pecl_pgsql.sh
  46. 3 3
      include/percona-5.5.sh
  47. 3 3
      include/percona-5.6.sh
  48. 3 3
      include/percona-5.7.sh
  49. 1 1
      include/php-5.3.sh
  50. 1 1
      include/php-5.4.sh
  51. 1 1
      include/php-5.5.sh
  52. 1 1
      include/php-5.6.sh
  53. 1 1
      include/php-7.0.sh
  54. 1 1
      include/php-7.1.sh
  55. 1 1
      include/php-7.2.sh
  56. 1 1
      include/phpmyadmin.sh
  57. 3 3
      include/postgresql.sh
  58. 5 5
      include/pureftpd.sh
  59. 3 3
      include/python.sh
  60. 4 4
      include/redis.sh
  61. 3 3
      include/tengine.sh
  62. 5 5
      include/tomcat-6.sh
  63. 5 5
      include/tomcat-7.sh
  64. 5 5
      include/tomcat-8.sh
  65. 5 5
      include/tomcat-9.sh
  66. 1 1
      include/upgrade_db.sh
  67. 2 2
      include/upgrade_memcached.sh
  68. 1 1
      include/upgrade_oneinstack.sh
  69. 1 1
      include/upgrade_php.sh
  70. 1 1
      include/upgrade_phpmyadmin.sh
  71. 1 1
      include/upgrade_redis.sh
  72. 1 1
      include/upgrade_web.sh
  73. 1 1
      include/xcache.sh
  74. 1 1
      include/zendopcache.sh
  75. 4 4
      install.sh
  76. 11 11
      ss.sh

+ 4 - 4
addons.sh

@@ -90,7 +90,7 @@ Install_fail2ban() {
   tar xzf fail2ban-${fail2ban_ver}.tar.gz
   pushd fail2ban-${fail2ban_ver}
   ${python_install_dir}/bin/python setup.py install
-  if [ "${OS}" == "CentOS" ]; then
+  if [ "${PM}" == 'yum' ]; then
     LOGPATH=/var/log/secure
     /bin/cp files/redhat-initd /etc/init.d/fail2ban
     sed -i "s@^FAIL2BAN=.*@FAIL2BAN=${python_install_dir}/bin/fail2ban-client@" /etc/init.d/fail2ban
@@ -99,7 +99,7 @@ Install_fail2ban() {
     chkconfig --add fail2ban
     chkconfig fail2ban on
   fi
-  if [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+  if [ "${PM}" == 'apt' ]; then
     LOGPATH=/var/log/auth.log
     /bin/cp files/debian-initd /etc/init.d/fail2ban
     sed -i 's@2 3 4 5@3 4 5@' /etc/init.d/fail2ban
@@ -355,7 +355,7 @@ What Are You Doing?
             elif [ "${phpext_option}" = '2' ]; then
               PHP_extension=imap
               IMAP_ARGS='--with-kerberos --with-imap --with-imap-ssl'
-              if [ "$OS" == 'CentOS' ]; then
+              if [ "${PM}" == 'yum' ]; then
                 yum -y install libc-client-devel
                 [ "${OS_BIT}" == '64' -a ! -e /usr/lib/libc-client.so ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
               else
@@ -459,7 +459,7 @@ What Are You Doing?
             pushd swoole-1.10.5
           fi
           ${php_install_dir}/bin/phpize
-          ./configure --with-php-config=${php_install_dir}/bin/php-config
+          ./configure --with-php-config=${php_install_dir}/bin/php-config --enable-openssl --with-openssl-dir=${openssl_install_dir}
           make -j ${THREAD} && make install
           popd
           rm -rf swoole-${swoole_ver}

+ 1 - 1
include/GraphicsMagick.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/ImageMagick.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/ZendGuardLoader.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/alisql-5.6.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -51,8 +51,8 @@ Install_AliSQL56() {
   sed -i "s@^basedir=.*@basedir=${alisql_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${alisql_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/apache-2.2.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -36,8 +36,8 @@ Install_Apache22() {
   sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
   sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd
   chmod +x /etc/init.d/httpd
-  [ "${OS}" == 'CentOS' ] && { chkconfig --add httpd; chkconfig httpd on; }
-  [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && update-rc.d httpd defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add httpd; chkconfig httpd on; }
+  [ "${PM}" == 'apt' ] && update-rc.d httpd defaults
 
   sed -i "s@^User daemon@User ${run_user}@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^Group daemon@Group ${run_user}@" ${apache_install_dir}/conf/httpd.conf

+ 3 - 3
include/apache-2.4.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -59,8 +59,8 @@ Install_Apache24() {
   sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
   sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd
   chmod +x /etc/init.d/httpd
-  [ "${OS}" == 'CentOS' ] && { chkconfig --add httpd; chkconfig httpd on; }
-  [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && update-rc.d httpd defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add httpd; chkconfig httpd on; }
+  [ "${PM}" == 'apt' ] && update-rc.d httpd defaults
 
   sed -i "s@^User daemon@User ${run_user}@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^Group daemon@Group ${run_user}@" ${apache_install_dir}/conf/httpd.conf

+ 1 - 1
include/apcu.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/check_dir.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/check_download.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # Author:  Alpha Eva <kaneawk AT gmail.com>
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -764,7 +764,7 @@ checkDownload() {
     src_url=http://download.redis.io/releases/redis-${redis_ver}.tar.gz && Download_src
     echo "Download redis pecl..."
     src_url=https://pecl.php.net/get/redis-${redis_pecl_ver}.tgz && Download_src
-    if [ "${OS}" == "CentOS" ]; then
+    if [ "${PM}" == 'yum' ]; then
       echo "Download start-stop-daemon.c for CentOS..."
       src_url=${mirrorLink}/start-stop-daemon.c && Download_src
     fi
@@ -798,7 +798,7 @@ checkDownload() {
 
   # others
   if [ "${downloadDepsSrc}" == '1' ]; then
-    if [ "${OS}" == "CentOS" ]; then
+    if [ "${PM}" == 'yum' ]; then
       echo "Download tmux for CentOS..."
       src_url=${mirrorLink}/libevent-${libevent_ver}.tar.gz && Download_src
       src_url=https://github.com/tmux/tmux/releases/download/${tmux_ver}/tmux-${tmux_ver}.tar.gz && Download_src

+ 11 - 7
include/check_os.sh

@@ -2,15 +2,24 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
 #       https://github.com/lj2007331/oneinstack
 
+if [ -e "/usr/bin/yum" ]; then
+  PM=yum
+  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { yum -y install redhat-lsb-core; clear; }
+elif [ -e "/usr/bin/apt-get" ]; then
+  PM=apt
+  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
+fi
+
+[ ! -e "$(which lsb_release 2>/dev/null)" ] && { echo "${CFAILURE}${PM} source failed! ${CEND}"; kill -9 $$; }
+
 if [ -e /etc/redhat-release ]; then
   OS=CentOS
-  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { yum -y install redhat-lsb-core; clear; }
   CentOS_ver=$(lsb_release -sr | awk -F. '{print $1}')
   [ "${CentOS_ver}" == '17' ] && CentOS_ver=7
   [ "$(lsb_release -is)" == 'Fedora' ] && [ ${CentOS_ver} -ge 19 >/dev/null 2>&1 ] && { CentOS_ver=7; Fedora_ver=$(lsb_release -rs); }
@@ -19,15 +28,12 @@ elif [ -n "$(grep 'Amazon Linux' /etc/issue)" ]; then
   CentOS_ver=7
 elif [ -n "$(grep 'bian' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Debian" ]; then
   OS=Debian
-  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
   Debian_ver=$(lsb_release -sr | awk -F. '{print $1}')
 elif [ -n "$(grep 'Deepin' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Deepin" ]; then
   OS=Debian
-  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
   Debian_ver=8
 elif [ -n "$(grep -w 'Kali' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Kali" ]; then
   OS=Debian
-  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
   if [ -n "$(grep 'VERSION="2016.*"' /etc/os-release)" ]; then
     Debian_ver=8
   elif [ -n "$(grep 'VERSION="2017.*"' /etc/os-release)" ]; then
@@ -37,12 +43,10 @@ elif [ -n "$(grep -w 'Kali' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" ==
   fi
 elif [ -n "$(grep 'Ubuntu' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Ubuntu" -o -n "$(grep 'Linux Mint' /etc/issue)" ]; then
   OS=Ubuntu
-  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
   Ubuntu_ver=$(lsb_release -sr | awk -F. '{print $1}')
   [ -n "$(grep 'Linux Mint 18' /etc/issue)" ] && Ubuntu_ver=16
 elif [ -n "$(grep 'elementary' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == 'elementary' ]; then
   OS=Ubuntu
-  [ ! -e "$(which lsb_release 2>/dev/null)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
   Ubuntu_ver=16
 else
   echo "${CFAILURE}Does not support this OS, Please contact the author! ${CEND}"

+ 3 - 3
include/check_sw.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # Author:  Alpha Eva <kaneawk AT gmail.com>
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -120,7 +120,7 @@ installDepsUbuntu() {
 
 installDepsBySrc() {
   pushd ${oneinstack_dir}/src > /dev/null
-  if [ "${OS}" == "Ubuntu" ]; then
+  if [ "${OS}" == 'Ubuntu' ]; then
     if [[ "${Ubuntu_ver}" =~ ^14$|^15$ ]]; then
       # Install bison on ubt 14.x 15.x
       tar xzf bison-${bison_ver}.tar.gz
@@ -130,7 +130,7 @@ installDepsBySrc() {
       popd
       rm -rf bison-${bison_ver}
     fi
-  elif [ "${OS}" == "CentOS" ]; then
+  elif [ "${OS}" == 'CentOS' ]; then
     # Install tmux
     if [ ! -e "$(which tmux)" ]; then
       # Install libevent first

+ 1 - 1
include/color.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/demo.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/download.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/eaccelerator.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/get_char.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/hhvm_CentOS.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/init_CentOS.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/init_Debian.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/init_Ubuntu.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/ioncube.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 2 - 2
include/jdk-1.6.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -14,7 +14,7 @@ Install-JDK16() {
   JAVA_dir=/usr/java
   JDK_NAME="jdk${jdk16_ver}"
   JDK_PATH=${JAVA_dir}/${JDK_NAME}
-  [ "${OS}" == 'CentOS' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
+  [ "${PM}" == 'yum' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
   chmod +x ${JDK_FILE}
   ./${JDK_FILE}
   [ ! -e ${JAVA_dir} ] && mkdir -p ${JAVA_dir}

+ 2 - 2
include/jdk-1.7.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -14,7 +14,7 @@ Install-JDK17() {
   JAVA_dir=/usr/java
   JDK_NAME="jdk${jdk17_ver}"
   JDK_PATH=${JAVA_dir}/${JDK_NAME}
-  [ "${OS}" == 'CentOS' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
+  [ "${PM}" == 'yum' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
   [ ! -e ${JAVA_dir} ] && mkdir -p ${JAVA_dir}
   tar xzf ${JDK_FILE} -C ${JAVA_dir}
   if [ -d "${JDK_PATH}" ]; then

+ 2 - 2
include/jdk-1.8.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -14,7 +14,7 @@ Install-JDK18() {
   JAVA_dir=/usr/java
   JDK_NAME="jdk${jdk18_ver}"
   JDK_PATH=${JAVA_dir}/${JDK_NAME}
-  [ "${OS}" == 'CentOS' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
+  [ "${PM}" == 'yum' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
   [ ! -e ${JAVA_dir} ] && mkdir -p ${JAVA_dir}
   tar xzf ${JDK_FILE} -C ${JAVA_dir}
   if [ -d "${JDK_PATH}" ]; then

+ 2 - 2
include/jdk-10.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -14,7 +14,7 @@ Install-JDK10() {
   JAVA_dir=/usr/java
   JDK_NAME="jdk-${jdk10_ver}"
   JDK_PATH=${JAVA_dir}/${JDK_NAME}
-  [ "${OS}" == 'CentOS' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
+  [ "${PM}" == 'yum' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
   [ ! -e ${JAVA_dir} ] && mkdir -p ${JAVA_dir}
   tar xzf ${JDK_FILE} -C ${JAVA_dir}
   if [ -d "${JDK_PATH}" ]; then

+ 1 - 1
include/jemalloc.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/mariadb-10.0.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -62,8 +62,8 @@ Install_MariaDB100() {
   sed -i "s@^basedir=.*@basedir=${mariadb_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mariadb_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mariadb-10.1.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -66,8 +66,8 @@ Install_MariaDB101() {
   sed -i "s@^basedir=.*@basedir=${mariadb_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mariadb_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mariadb-10.2.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -66,8 +66,8 @@ Install_MariaDB102() {
   sed -i "s@^basedir=.*@basedir=${mariadb_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mariadb_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mariadb-10.3.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -66,8 +66,8 @@ Install_MariaDB103() {
   sed -i "s@^basedir=.*@basedir=${mariadb_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mariadb_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mariadb-5.5.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -64,8 +64,8 @@ Install_MariaDB55() {
   sed -i "s@^basedir=.*@basedir=${mariadb_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mariadb_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 6 - 6
include/memcached.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -17,7 +17,7 @@ Install_memcached() {
   tar xzf memcached-${memcached_ver}.tar.gz
   pushd memcached-${memcached_ver}
   [ ! -d "${memcached_install_dir}" ] && mkdir -p ${memcached_install_dir}
-  [ "${OS}" == "CentOS" ] && libevent_arg='--with-libevent=/usr/local'
+  [ "${PM}" == 'yum' ] && libevent_arg='--with-libevent=/usr/local'
   ./configure --prefix=${memcached_install_dir} ${libevent_arg}
   make -j ${THREAD} && make install
   popd
@@ -25,8 +25,8 @@ Install_memcached() {
     echo "${CSUCCESS}memcached installed successfully! ${CEND}"
     rm -rf memcached-${memcached_ver}
     ln -s ${memcached_install_dir}/bin/memcached /usr/bin/memcached
-    [ "${OS}" == "CentOS" ] && { /bin/cp ../init.d/Memcached-init-CentOS /etc/init.d/memcached; chkconfig --add memcached; chkconfig memcached on; }
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Memcached-init-Ubuntu /etc/init.d/memcached; update-rc.d memcached defaults; }
+    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Memcached-init-CentOS /etc/init.d/memcached; chkconfig --add memcached; chkconfig memcached on; }
+    [ "${PM}" == 'apt' ] && { /bin/cp ../init.d/Memcached-init-Ubuntu /etc/init.d/memcached; update-rc.d memcached defaults; }
     sed -i "s@/usr/local/memcached@${memcached_install_dir}@g" /etc/init.d/memcached
     let memcachedCache="${Mem}/8"
     [ -n "$(grep 'CACHESIZE=' /etc/init.d/memcached)" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=${memcachedCache}@" /etc/init.d/memcached
@@ -79,8 +79,8 @@ Install_php-memcached() {
     tar xzf libmemcached-${libmemcached_ver}.tar.gz
     patch -d libmemcached-${libmemcached_ver} -p0 < libmemcached-build.patch
     pushd libmemcached-${libmemcached_ver}
-    [ "${OS}" == "CentOS" ] && yum -y install cyrus-sasl-devel
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && sed -i "s@lthread -pthread -pthreads@lthread -lpthread -pthreads@" ./configure
+    [ "${PM}" == 'yum' ] && yum -y install cyrus-sasl-devel
+    [ "${PM}" == 'apt' ] && sed -i "s@lthread -pthread -pthreads@lthread -lpthread -pthreads@" ./configure
     ./configure --with-memcached=${memcached_install_dir}
     make -j ${THREAD} && make install
     popd

+ 1 - 1
include/memory.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/mongodb.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -15,8 +15,8 @@ Install_MongoDB() {
   mkdir -p ${mongo_data_dir};chown mongod.mongod -R ${mongo_data_dir}
   tar xzf mongodb-linux-${SYS_BIT_b}-${mongodb_ver}.tgz
   /bin/mv mongodb-linux-${SYS_BIT_b}-${mongodb_ver} ${mongo_install_dir}
-  [ "${OS}" == "CentOS" ] && { /bin/cp ../init.d/MongoDB-init-CentOS /etc/init.d/mongod; sed -i "s@/usr/local/mongodb@${mongo_install_dir}@g" /etc/init.d/mongod; chkconfig --add mongod; chkconfig mongod on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/MongoDB-init-Ubuntu /etc/init.d/mongod; sed -i "s@/usr/local/mongodb@${mongo_install_dir}@g" /etc/init.d/mongod; update-rc.d mongod defaults; }
+  [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/MongoDB-init-CentOS /etc/init.d/mongod; sed -i "s@/usr/local/mongodb@${mongo_install_dir}@g" /etc/init.d/mongod; chkconfig --add mongod; chkconfig mongod on; }
+  [ "${PM}" == 'apt' ] && { /bin/cp ../init.d/MongoDB-init-Ubuntu /etc/init.d/mongod; sed -i "s@/usr/local/mongodb@${mongo_install_dir}@g" /etc/init.d/mongod; update-rc.d mongod defaults; }
   cat > /etc/mongod.conf << EOF
 # mongod.conf
 

+ 3 - 3
include/mysql-5.5.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -64,8 +64,8 @@ Install_MySQL55() {
   sed -i "s@^basedir=.*@basedir=${mysql_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mysql_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mysql-5.6.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -62,8 +62,8 @@ Install_MySQL56() {
   sed -i "s@^basedir=.*@basedir=${mysql_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mysql_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mysql-5.7.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -66,8 +66,8 @@ Install_MySQL57() {
   sed -i "s@^basedir=.*@basedir=${mysql_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mysql_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/mysql-8.0.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -64,8 +64,8 @@ Install_MySQL80() {
   sed -i "s@^basedir=.*@basedir=${mysql_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${mysql_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/nginx.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -51,8 +51,8 @@ Install_Nginx() {
     sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /lib/systemd/system/nginx.service
     systemctl enable nginx
   else
-    [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-    [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
+    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+    [ "${PM}" == 'apt' ] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
   fi
 
   mv ${nginx_install_dir}/conf/nginx.conf{,_bk}

+ 1 - 1
include/ngx_lua_waf.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/openresty.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -48,8 +48,8 @@ Install_OpenResty() {
     sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /lib/systemd/system/nginx.service
     systemctl enable nginx
   else
-    [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-    [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
+    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+    [ "${PM}" == 'apt' ] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
   fi
 
   mv ${openresty_install_dir}/nginx/conf/nginx.conf{,_bk}

+ 1 - 1
include/openssl.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/pecl_mongodb.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/pecl_pgsql.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/percona-5.5.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -65,8 +65,8 @@ Install_Percona55() {
   sed -i "s@^basedir=.*@basedir=${percona_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${percona_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/percona-5.6.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -64,8 +64,8 @@ Install_Percona56() {
   sed -i "s@^basedir=.*@basedir=${percona_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${percona_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 3 - 3
include/percona-5.7.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -68,8 +68,8 @@ Install_Percona57() {
   sed -i "s@^basedir=.*@basedir=${percona_install_dir}@" /etc/init.d/mysqld
   sed -i "s@^datadir=.*@datadir=${percona_data_dir}@" /etc/init.d/mysqld
   chmod +x /etc/init.d/mysqld
-  [ "${OS}" == "CentOS" ] && { chkconfig --add mysqld; chkconfig mysqld on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d mysqld defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add mysqld; chkconfig mysqld on; }
+  [ "${PM}" == 'apt' ] && update-rc.d mysqld defaults
   popd
 
   # my.cnf

+ 1 - 1
include/php-5.3.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/php-5.4.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/php-5.5.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/php-5.6.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/php-7.0.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/php-7.1.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/php-7.2.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/phpmyadmin.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 3 - 3
include/postgresql.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -24,8 +24,8 @@ Install_PostgreSQL() {
   sed -i "s@^prefix=.*@prefix=${pgsql_install_dir}@" /etc/init.d/postgresql
   sed -i "s@^PGDATA=.*@PGDATA=${pgsql_data_dir}@" /etc/init.d/postgresql
   chmod +x /etc/init.d/postgresql
-  [ "${OS}" == "CentOS" ] && { chkconfig --add postgresql; chkconfig postgresql on; }
-  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d postgresql defaults
+  [ "${PM}" == 'yum' ] && { chkconfig --add postgresql; chkconfig postgresql on; }
+  [ "${PM}" == 'apt' ] && update-rc.d postgresql defaults
   popd
   su - postgres -c "${pgsql_install_dir}/bin/initdb -D ${pgsql_data_dir}"
   service postgresql start

+ 5 - 5
include/pureftpd.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -28,8 +28,8 @@ Install_PureFTPd() {
       /bin/cp ../init.d/Pureftpd-init /etc/init.d/pureftpd
       sed -i "s@/usr/local/pureftpd@${pureftpd_install_dir}@g" /etc/init.d/pureftpd
       chmod +x /etc/init.d/pureftpd
-      [ "${OS}" == 'CentOS' ] && { chkconfig --add pureftpd; chkconfig pureftpd on; }
-      [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && { sed -i 's@^. /etc/rc.d/init.d/functions@. /lib/lsb/init-functions@' /etc/init.d/pureftpd; update-rc.d pureftpd defaults; }
+      [ "${PM}" == 'yum' ] && { chkconfig --add pureftpd; chkconfig pureftpd on; }
+      [ "${PM}" == 'apt' ] && { sed -i 's@^. /etc/rc.d/init.d/functions@. /lib/lsb/init-functions@' /etc/init.d/pureftpd; update-rc.d pureftpd defaults; }
       [ "${Debian_ver}" == '7' ] && sed -i 's@/var/lock/subsys/@/var/lock/@g' /etc/init.d/pureftpd
     fi
 
@@ -50,13 +50,13 @@ Install_PureFTPd() {
 
     # iptables Ftp
     if [ "${iptables_yn}" == 'y' ]; then
-      if [ "${OS}" == "CentOS" ]; then
+      if [ "${PM}" == 'yum' ]; then
         if [ -z "$(grep '20000:30000' /etc/sysconfig/iptables)" ]; then
           iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
           iptables -I INPUT 6 -p tcp -m state --state NEW -m tcp --dport 20000:30000 -j ACCEPT
           service iptables save
         fi
-      elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+      elif [ "${PM}" == 'apt' ]; then
         if [ -z "$(grep '20000:30000' /etc/iptables.up.rules)" ]; then
           iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
           iptables -I INPUT 6 -p tcp -m state --state NEW -m tcp --dport 20000:30000 -j ACCEPT

+ 3 - 3
include/python.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -32,12 +32,12 @@ gpgcheck=0
 EOF
   fi
 
-  if [ "${OS}" == "CentOS" ]; then
+  if [ "${PM}" == 'yum' ]; then
     pkgList="gcc dialog augeas-libs openssl openssl-devel libffi-devel redhat-rpm-config ca-certificates"
     for Package in ${pkgList}; do
       yum -y install ${Package}
     done
-  elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+  elif [ "${PM}" == 'apt' ]; then
     pkgList="gcc dialog libaugeas0 augeas-lenses libssl-dev libffi-dev ca-certificates"
     for Package in ${pkgList}; do
       apt-get -y install $Package

+ 4 - 4
include/redis.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -12,7 +12,7 @@ Install_redis-server() {
   pushd ${oneinstack_dir}/src > /dev/null
   tar xzf redis-${redis_ver}.tar.gz
   pushd redis-${redis_ver}
-  if [ "${OS_BIT}" == '32' ]; then
+  if [ "${OS_BIT}" == '32' -a "${armplatform}" != 'y' ]; then
     sed -i '1i\CFLAGS= -march=i686' src/Makefile
     sed -i 's@^OPT=.*@OPT=-O2 -march=i686@' src/.make-settings
   fi
@@ -43,8 +43,8 @@ Install_redis-server() {
     else
       /bin/cp ../init.d/Redis-server-init /etc/init.d/redis-server
       sed -i "s@/usr/local/redis@${redis_install_dir}@g" /etc/init.d/redis-server
-      [ "${OS}" == 'CentOS' ] && { cc start-stop-daemon.c -o /sbin/start-stop-daemon; chkconfig --add redis-server; chkconfig redis-server on; }
-      [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && update-rc.d redis-server defaults
+      [ "${PM}" == 'yum' ] && { cc start-stop-daemon.c -o /sbin/start-stop-daemon; chkconfig --add redis-server; chkconfig redis-server on; }
+      [ "${PM}" == 'apt' ] && update-rc.d redis-server defaults
     fi
     #[ -z "`grep 'vm.overcommit_memory' /etc/sysctl.conf`" ] && echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
     #sysctl -p

+ 3 - 3
include/tengine.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -49,8 +49,8 @@ Install_Tengine() {
     sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /lib/systemd/system/nginx.service
     systemctl enable nginx
   else
-    [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-    [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
+    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+    [ "${PM}" == 'apt' ] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
   fi
 
   mv ${tengine_install_dir}/conf/nginx.conf{,_bk}

+ 5 - 5
include/tomcat-6.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -72,12 +72,12 @@ EOF
     sed -i /ThreadLocalLeakPreventionListener/d ${tomcat_install_dir}/conf/server.xml
     if [ ! -e "${nginx_install_dir}/sbin/nginx" -a ! -e "${tengine_install_dir}/sbin/nginx" -a ! -e "${openresty_install_dir}/nginx/sbin/nginx" -a ! -e "${apache_install_dir}/conf/httpd.conf" ]; then
       if [ "${iptables_yn}" == 'y' ]; then
-        if [ "${OS}" == "CentOS" ]; then
+        if [ "${PM}" == 'yum' ]; then
           if [ -z "$(grep -w '8080' /etc/sysconfig/iptables)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             service iptables save
           fi
-        elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+        elif [ "${PM}" == 'apt' ]; then
           if [ -z "$(grep -w '8080' /etc/iptables.up.rules)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             iptables-save > /etc/iptables.up.rules
@@ -124,8 +124,8 @@ EOF
     sed -i "s@JAVA_HOME=.*@JAVA_HOME=${JAVA_HOME}@" /etc/init.d/tomcat
     sed -i "s@^CATALINA_HOME=.*@CATALINA_HOME=${tomcat_install_dir}@" /etc/init.d/tomcat
     sed -i "s@^TOMCAT_USER=.*@TOMCAT_USER=${run_user}@" /etc/init.d/tomcat
-    [ "${OS}" == "CentOS" ] && { chkconfig --add tomcat; chkconfig tomcat on; }
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d tomcat defaults
+    [ "${PM}" == 'yum' ] && { chkconfig --add tomcat; chkconfig tomcat on; }
+    [ "${PM}" == 'apt' ] && update-rc.d tomcat defaults
     echo "${CSUCCESS}Tomcat installed successfully! ${CEND}"
     rm -rf apache-tomcat-${tomcat6_ver}
   else

+ 5 - 5
include/tomcat-7.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -72,12 +72,12 @@ EOF
 
     if [ ! -e "${nginx_install_dir}/sbin/nginx" -a ! -e "${tengine_install_dir}/sbin/nginx" -a ! -e "${openresty_install_dir}/nginx/sbin/nginx" -a ! -e "${apache_install_dir}/conf/httpd.conf" ]; then
       if [ "${iptables_yn}" == 'y' ]; then
-        if [ "${OS}" == "CentOS" ]; then
+        if [ "${PM}" == 'yum' ]; then
           if [ -z "$(grep -w '8080' /etc/sysconfig/iptables)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             service iptables save
           fi
-        elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+        elif [ "${PM}" == 'apt' ]; then
           if [ -z "$(grep -w '8080' /etc/iptables.up.rules)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             iptables-save > /etc/iptables.up.rules
@@ -124,8 +124,8 @@ EOF
     sed -i "s@JAVA_HOME=.*@JAVA_HOME=${JAVA_HOME}@" /etc/init.d/tomcat
     sed -i "s@^CATALINA_HOME=.*@CATALINA_HOME=${tomcat_install_dir}@" /etc/init.d/tomcat
     sed -i "s@^TOMCAT_USER=.*@TOMCAT_USER=${run_user}@" /etc/init.d/tomcat
-    [ "${OS}" == "CentOS" ] && { chkconfig --add tomcat; chkconfig tomcat on; }
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d tomcat defaults
+    [ "${PM}" == 'yum' ] && { chkconfig --add tomcat; chkconfig tomcat on; }
+    [ "${PM}" == 'apt' ] && update-rc.d tomcat defaults
     echo "${CSUCCESS}Tomcat installed successfully! ${CEND}"
     rm -rf apache-tomcat-${tomcat7_ver}
   else

+ 5 - 5
include/tomcat-8.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -72,12 +72,12 @@ EOF
 
     if [ ! -e "${nginx_install_dir}/sbin/nginx" -a ! -e "${tengine_install_dir}/sbin/nginx" -a ! -e "${openresty_install_dir}/nginx/sbin/nginx" -a ! -e "${apache_install_dir}/conf/httpd.conf" ]; then
       if [ "${iptables_yn}" == 'y' ]; then
-        if [ "${OS}" == "CentOS" ]; then
+        if [ "${PM}" == 'yum' ]; then
           if [ -z "$(grep -w '8080' /etc/sysconfig/iptables)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             service iptables save
           fi
-        elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+        elif [ "${PM}" == 'apt' ]; then
           if [ -z "$(grep -w '8080' /etc/iptables.up.rules)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             iptables-save > /etc/iptables.up.rules
@@ -124,8 +124,8 @@ EOF
     sed -i "s@JAVA_HOME=.*@JAVA_HOME=${JAVA_HOME}@" /etc/init.d/tomcat
     sed -i "s@^CATALINA_HOME=.*@CATALINA_HOME=${tomcat_install_dir}@" /etc/init.d/tomcat
     sed -i "s@^TOMCAT_USER=.*@TOMCAT_USER=${run_user}@" /etc/init.d/tomcat
-    [ "${OS}" == "CentOS" ] && { chkconfig --add tomcat; chkconfig tomcat on; }
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d tomcat defaults
+    [ "${PM}" == 'yum' ] && { chkconfig --add tomcat; chkconfig tomcat on; }
+    [ "${PM}" == 'apt' ] && update-rc.d tomcat defaults
     echo "${CSUCCESS}Tomcat installed successfully! ${CEND}"
     rm -rf apache-tomcat-${tomcat8_ver}
   else

+ 5 - 5
include/tomcat-9.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -72,12 +72,12 @@ EOF
 
     if [ ! -e "${nginx_install_dir}/sbin/nginx" -a ! -e "${tengine_install_dir}/sbin/nginx" -a ! -e "${openresty_install_dir}/nginx/sbin/nginx" -a ! -e "${apache_install_dir}/conf/httpd.conf" ]; then
       if [ "${iptables_yn}" == 'y' ]; then
-        if [ "${OS}" == "CentOS" ]; then
+        if [ "${PM}" == 'yum' ]; then
           if [ -z "$(grep -w '8080' /etc/sysconfig/iptables)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             service iptables save
           fi
-        elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+        elif [ "${PM}" == 'apt' ]; then
           if [ -z "$(grep -w '8080' /etc/iptables.up.rules)" ]; then
             iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
             iptables-save > /etc/iptables.up.rules
@@ -124,8 +124,8 @@ EOF
     sed -i "s@JAVA_HOME=.*@JAVA_HOME=${JAVA_HOME}@" /etc/init.d/tomcat
     sed -i "s@^CATALINA_HOME=.*@CATALINA_HOME=${tomcat_install_dir}@" /etc/init.d/tomcat
     sed -i "s@^TOMCAT_USER=.*@TOMCAT_USER=${run_user}@" /etc/init.d/tomcat
-    [ "${OS}" == "CentOS" ] && { chkconfig --add tomcat; chkconfig tomcat on; }
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d tomcat defaults
+    [ "${PM}" == 'yum' ] && { chkconfig --add tomcat; chkconfig tomcat on; }
+    [ "${PM}" == 'apt' ] && update-rc.d tomcat defaults
     echo "${CSUCCESS}Tomcat installed successfully! ${CEND}"
     rm -rf apache-tomcat-${tomcat9_ver}
   else

+ 1 - 1
include/upgrade_db.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 2 - 2
include/upgrade_memcached.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com
@@ -39,7 +39,7 @@ Upgrade_Memcached() {
     tar xzf memcached-${NEW_memcached_ver}.tar.gz
     pushd memcached-${NEW_memcached_ver}
     make clean
-    [ "${OS}" == "CentOS" ] && libevent_arg='--with-libevent=/usr/local'
+    [ "${PM}" == 'yum' ] && libevent_arg='--with-libevent=/usr/local'
     ./configure --prefix=${memcached_install_dir} ${libevent_arg}
     make -j ${THREAD}
 

+ 1 - 1
include/upgrade_oneinstack.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/upgrade_php.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/upgrade_phpmyadmin.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/upgrade_redis.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/upgrade_web.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/xcache.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 1 - 1
include/zendopcache.sh

@@ -2,7 +2,7 @@
 # Author:  yeho <lj2007331 AT gmail.com>
 # BLOG:  https://blog.linuxeye.cn
 #
-# Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
+# Notes: OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+
 #
 # Project home page:
 #       https://oneinstack.com

+ 4 - 4
install.sh

@@ -638,7 +638,7 @@ if [ ${ARG_NUM} == 0 ]; then
     else
       if [ "${hhvm_yn}" == 'y' ]; then
         [ -e "/usr/bin/hhvm" ] && { echo "${CWARNING}HHVM already installed! ${CEND}"; hhvm_yn=Other; break; }
-        if [ "${OS}" == 'CentOS' -a "${OS_BIT}" == '64' ] && [ -n "`grep -E ' 7\.| 6\.[5-9]' /etc/redhat-release`" ]; then
+        if [ "${PM}" == 'yum' -a "${OS_BIT}" == '64' ] && [ -n "`grep -E ' 7\.| 6\.[5-9]' /etc/redhat-release`" ]; then
           break
         else
           echo
@@ -661,8 +661,8 @@ IPADDR_COUNTRY=$(./include/get_ipaddr_state.py $PUBLIC_IPADDR)
 # Check download source packages
 . ./include/check_download.sh
 downloadDepsSrc=1
-[ "${OS}" == 'CentOS' ] && yum -y -q install wget
-[[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] &&  apt -y -q install wget
+[ "${PM}" == 'yum' ] && yum -y -q install wget
+[ "${PM}" == 'apt' ] && apt-get -y -q install wget
 checkDownload 2>&1 | tee -a ${oneinstack_dir}/install.log
 
 # del openssl for jcloud
@@ -966,7 +966,7 @@ fi
 . include/check_dir.sh
 
 # HHVM
-if [ "${hhvm_yn}" == 'y' ] && [ "${OS}" == 'CentOS' -a "${OS_BIT}" == '64' ] && [ -n "`grep -E ' 7\.| 6\.[5-9]' /etc/redhat-release`" ]; then
+if [ "${hhvm_yn}" == 'y' ] && [ "${PM}" == 'yum' -a "${OS_BIT}" == '64' ] && [ -n "`grep -E ' 7\.| 6\.[5-9]' /etc/redhat-release`" ]; then
   . include/hhvm_CentOS.sh
   Install_hhvm_CentOS 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi

+ 11 - 11
ss.sh

@@ -13,7 +13,7 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
 clear
 printf "
 #######################################################################
-#       OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+      #
+#       OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+      #
 #                         Install SS Server                           #
 #       For more information please visit https://oneinstack.com      #
 #######################################################################
@@ -70,13 +70,13 @@ Iptables_set() {
     fi
   done
 
-  if [ "${OS}" == 'CentOS' ]; then
+  if [ "${PM}" == 'yum' ]; then
     if [ -n "`grep 'dport 80 ' /etc/sysconfig/iptables`" -a -z "$(grep -E ${SS_port} /etc/sysconfig/iptables)" ]; then
       iptables -I INPUT 4 -p udp -m state --state NEW -m udp --dport ${SS_port} -j ACCEPT
       iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport ${SS_port} -j ACCEPT
       service iptables save
     fi
-  elif [[ ${OS} =~ ^Ubuntu$|^Debian$ ]]; then
+  elif [ "${PM}" == 'apt' ]; then
     if [ -n "`grep 'dport 80 ' /etc/iptables.up.rules`" -a -z "$(grep -E ${SS_port} /etc/iptables.up.rules)" ]; then
       iptables -I INPUT 4 -p udp -m state --state NEW -m udp --dport ${SS_port} -j ACCEPT
       iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport ${SS_port} -j ACCEPT
@@ -101,12 +101,12 @@ Def_parameter() {
   done
   AddUser_SS
   Iptables_set
-  if [ "${OS}" == "CentOS" ]; then
+  if [ "${PM}" == 'yum' ]; then
     pkgList="wget unzip openssl-devel gcc swig autoconf libtool libevent automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel git asciidoc xmlto c-ares-devel pcre-devel udns-devel libev-devel"
     for Package in ${pkgList}; do
       yum -y install ${Package}
     done
-  elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+  elif [ "${PM}" == 'apt' ]; then
     apt-get -y update
     pkgList="curl wget unzip gcc swig automake make perl cpio git libudns-dev libev-dev gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libc-ares-dev"
     for Package in ${pkgList}; do
@@ -125,8 +125,8 @@ Install_SS-python() {
     /bin/cp ../init.d/SS-python-init /etc/init.d/shadowsocks
     chmod +x /etc/init.d/shadowsocks
     sed -i "s@SS_bin=.*@SS_bin=${python_install_dir}/bin/ssserver@" /etc/init.d/shadowsocks
-    [ "${OS}" == "CentOS" ] && { chkconfig --add shadowsocks; chkconfig shadowsocks on; }
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d shadowsocks defaults
+    [ "${PM}" == 'yum' ] && { chkconfig --add shadowsocks; chkconfig shadowsocks on; }
+    [ "${PM}" == 'apt' ] && update-rc.d shadowsocks defaults
   else
     echo
     echo "${CQUESTION}SS-python install failed! Please visit https://oneinstack.com${CEND}"
@@ -160,11 +160,11 @@ Install_SS-libev() {
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   if [ -f /usr/local/bin/ss-server ]; then
-    if [ "${OS}" == "CentOS" ]; then
+    if [ "${PM}" == 'yum' ]; then
       /bin/cp ../init.d/SS-libev-init-CentOS /etc/init.d/shadowsocks
       chkconfig --add shadowsocks
       chkconfig shadowsocks on
-    elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+    elif [ "${PM}" == 'apt' ]; then
       /bin/cp ../init.d/SS-libev-init-Ubuntu /etc/init.d/shadowsocks
       update-rc.d shadowsocks defaults
     fi
@@ -187,8 +187,8 @@ Uninstall_SS() {
 
   if [ "${SS_yn}" == 'y' ]; then
     [ -n "$(ps -ef | grep -v grep | grep -iE "ssserver|ss-server")" ] && /etc/init.d/shadowsocks stop
-    [ "${OS}" == "CentOS" ] && chkconfig --del shadowsocks
-    [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d -f shadowsocks remove
+    [ "${PM}" == 'yum' ] && chkconfig --del shadowsocks
+    [ "${PM}" == 'apt' ] && update-rc.d -f shadowsocks remove
     rm -rf /etc/shadowsocks /var/run/shadowsocks.pid /etc/init.d/shadowsocks
     if [ "${ss_option}" == '1' ]; then
       rm -f /usr/local/bin/{ss-local,ss-tunnel,ss-server,ss-manager,ss-redir}