lj2007331@gmail.com 6 роки тому
батько
коміт
8a5e5a655f

+ 34 - 34
addons.sh

@@ -64,25 +64,25 @@ while :; do
       Show_Help; exit 0
       ;;
     -i|--install)
-      install_yn=y; shift 1
+      install_flag=y; shift 1
       ;;
     -u|--uninstall)
-      uninstall_yn=y; shift 1
+      uninstall_flag=y; shift 1
       ;;
     --composer)
-      composer_yn=y; shift 1
+      composer_flag=y; shift 1
       ;;
     --fail2ban)
-      fail2ban_yn=y; shift 1
+      fail2ban_flag=y; shift 1
       ;;
     --ngx_lua_waf)
-      ngx_lua_waf_yn=y; shift 1
+      ngx_lua_waf_flag=y; shift 1
       ;;
     --python)
-      python_yn=y; shift 1
+      python_flag=y; shift 1
       ;;
     --panel)
-      panel_yn=y; shift 1
+      panel_flag=y; shift 1
       ;;
     --)
       shift
@@ -104,8 +104,8 @@ ACTION_FUN() {
     if [[ ! "${ACTION}" =~ ^[1,2]$ ]]; then
       echo "${CWARNING}input error! Please only input number 1~2${CEND}"
     else
-      [ "${ACTION}" == '1' ] && install_yn=y
-      [ "${ACTION}" == '2' ] && uninstall_yn=y
+      [ "${ACTION}" == '1' ] && install_flag=y
+      [ "${ACTION}" == '2' ] && uninstall_flag=y
       break
     fi
   done
@@ -128,45 +128,45 @@ What Are You Doing?
       case "${Number}" in
         1)
           ACTION_FUN
-          if [ "${install_yn}" = 'y' ]; then
+          if [ "${install_flag}" = 'y' ]; then
             Install_composer
-          elif [ "${uninstall_yn}" = 'y' ]; then
+          elif [ "${uninstall_flag}" = 'y' ]; then
             Uninstall_composer
           fi
           ;;
         2)
           ACTION_FUN
-          if [ "${install_yn}" = 'y' ]; then
+          if [ "${install_flag}" = 'y' ]; then
             Install_Python
             Install_fail2ban
-          elif [ "${uninstall_yn}" = 'y' ]; then
+          elif [ "${uninstall_flag}" = 'y' ]; then
             Uninstall_fail2ban
           fi
           ;;
         3)
           ACTION_FUN
-          if [ "${install_yn}" = 'y' ]; then
+          if [ "${install_flag}" = 'y' ]; then
             [ -e "${nginx_install_dir}/sbin/nginx" ] && Nginx_lua_waf
             [ -e "${tengine_install_dir}/sbin/nginx" ] && Tengine_lua_waf
             enable_lua_waf
-          elif [ "${uninstall_yn}" = 'y' ]; then
+          elif [ "${uninstall_flag}" = 'y' ]; then
             disable_lua_waf
           fi
           ;;
         4)
           ACTION_FUN
-          if [ "${install_yn}" = 'y' ]; then
+          if [ "${install_flag}" = 'y' ]; then
             Install_Python
-          elif [ "${uninstall_yn}" = 'y' ]; then
+          elif [ "${uninstall_flag}" = 'y' ]; then
             Uninstall_Python
           fi
           ;;
         5)
           ACTION_FUN
-          if [ "${install_yn}" = 'y' ]; then
+          if [ "${install_flag}" = 'y' ]; then
             Install_Python
             Install_Panel
-          elif [ "${uninstall_yn}" = 'y' ]; then
+          elif [ "${uninstall_flag}" = 'y' ]; then
             Uninstall_Panel
           fi
           ;;
@@ -181,42 +181,42 @@ What Are You Doing?
 if [ ${ARG_NUM} == 0 ]; then
   Menu
 else
-  if [ "${composer_yn}" == 'y' ]; then
-    if [ "${install_yn}" = 'y' ]; then
+  if [ "${composer_flag}" == 'y' ]; then
+    if [ "${install_flag}" = 'y' ]; then
       Install_composer
-    elif [ "${uninstall_yn}" = 'y' ]; then
+    elif [ "${uninstall_flag}" = 'y' ]; then
       Uninstall_composer
     fi
   fi
-  if [ "${fail2ban_yn}" == 'y' ]; then
-    if [ "${install_yn}" = 'y' ]; then
+  if [ "${fail2ban_flag}" == 'y' ]; then
+    if [ "${install_flag}" = 'y' ]; then
       Install_Python
       Install_fail2ban
-    elif [ "${uninstall_yn}" = 'y' ]; then
+    elif [ "${uninstall_flag}" = 'y' ]; then
       Uninstall_fail2ban
     fi
   fi
-  if [ "${ngx_lua_waf_yn}" == 'y' ]; then
-    if [ "${install_yn}" = 'y' ]; then
+  if [ "${ngx_lua_waf_flag}" == 'y' ]; then
+    if [ "${install_flag}" = 'y' ]; then
       [ -e "${nginx_install_dir}/sbin/nginx" ] && Nginx_lua_waf
       [ -e "${tengine_install_dir}/sbin/nginx" ] && Tengine_lua_waf
       enable_lua_waf
-    elif [ "${uninstall_yn}" = 'y' ]; then
+    elif [ "${uninstall_flag}" = 'y' ]; then
       disable_lua_waf
     fi
   fi
-  if [ "${python_yn}" == 'y' ]; then
-    if [ "${install_yn}" = 'y' ]; then
+  if [ "${python_flag}" == 'y' ]; then
+    if [ "${install_flag}" = 'y' ]; then
       Install_Python
-    elif [ "${uninstall_yn}" = 'y' ]; then
+    elif [ "${uninstall_flag}" = 'y' ]; then
       Uninstall_Python
     fi
   fi
-  if [ "${panel_yn}" == 'y' ]; then
-    if [ "${install_yn}" = 'y' ]; then
+  if [ "${panel_flag}" == 'y' ]; then
+    if [ "${install_flag}" = 'y' ]; then
       Install_Python
       Install_Panel
-    elif [ "${uninstall_yn}" = 'y' ]; then
+    elif [ "${uninstall_flag}" = 'y' ]; then
       Uninstall_Panel
     fi
   fi

+ 3 - 3
backup_setup.sh

@@ -166,14 +166,14 @@ if [ -n "`echo ${desc_bk} | grep -w 2`" ]; then
     if [ $? -eq 0 ]; then
       [ -z "`grep ${remote_address} tools/iplist.txt`" ] && echo "${remote_address} ${remote_port} ${remote_user} $remote_password" >> tools/iplist.txt || echo "${CWARNING}${remote_address} has been added! ${CEND}"
       while :; do
-        read -e -p "Do you want to add more host ? [y/n]: " morehost_yn
-        if [[ ! ${morehost_yn} =~ ^[y,n]$ ]]; then
+        read -e -p "Do you want to add more host ? [y/n]: " morehost_flag
+        if [[ ! ${morehost_flag} =~ ^[y,n]$ ]]; then
           echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
         else
           break
         fi
       done
-      [ "${morehost_yn}" == 'n' ] && break
+      [ "${morehost_flag}" == 'n' ] && break
     fi
   done
 fi

+ 113 - 113
include/check_download.sh

@@ -19,101 +19,102 @@ checkDownload() {
   fi
 
   # jemalloc
-  if [[ ${nginx_option} =~ ^[1-3]$ ]] || [ "${db_yn}" == 'y' ]; then
+  if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-5]$ ]]; then
     echo "Download jemalloc..."
     src_url=${mirrorLink}/jemalloc-${jemalloc_ver}.tar.bz2 && Download_src
   fi
 
-  # Web
-  if [ "${web_yn}" == 'y' ]; then
-    case "${nginx_option}" in
-      1)
-        echo "Download openSSL1.1..."
-        src_url=https://www.openssl.org/source/openssl-${openssl11_ver}.tar.gz && Download_src
-        echo "Download nginx..."
-        src_url=http://nginx.org/download/nginx-${nginx_ver}.tar.gz && Download_src
-        ;;
-      2)
-        echo "Download tengine..."
-        src_url=http://tengine.taobao.org/download/tengine-${tengine_ver}.tar.gz && Download_src
-        ;;
-      3)
-        echo "Download openresty..."
-        src_url=https://openresty.org/download/openresty-${openresty_ver}.tar.gz && Download_src
-        ;;
-    esac
+  # nginx/tengine/openresty
+  case "${nginx_option}" in
+    1)
+      echo "Download openSSL1.1..."
+      src_url=https://www.openssl.org/source/openssl-${openssl11_ver}.tar.gz && Download_src
+      echo "Download nginx..."
+      src_url=http://nginx.org/download/nginx-${nginx_ver}.tar.gz && Download_src
+      ;;
+    2)
+      echo "Download tengine..."
+      src_url=http://tengine.taobao.org/download/tengine-${tengine_ver}.tar.gz && Download_src
+      ;;
+    3)
+      echo "Download openresty..."
+      src_url=https://openresty.org/download/openresty-${openresty_ver}.tar.gz && Download_src
+      ;;
+  esac
 
-    if [[ "${nginx_option}" =~ ^[1-3]$ || ${apache_option} == '1' ]]; then
-      echo "Download pcre..."
-      src_url=https://ftp.pcre.org/pub/pcre/pcre-${pcre_ver}.tar.gz && Download_src
-    fi
+  # pcre
+  if [[ "${nginx_option}" =~ ^[1-3]$ || ${apache_option} == '1' ]]; then
+    echo "Download pcre..."
+    src_url=https://ftp.pcre.org/pub/pcre/pcre-${pcre_ver}.tar.gz && Download_src
+  fi
 
-    # apache
-    if [ "${apache_option}" == '1' ]; then
+  # apache
+  case "${apache_option}" in
+    1)
       echo "Download apache 2.4..."
       src_url=http://archive.apache.org/dist/httpd/httpd-${apache24_ver}.tar.gz && Download_src
       src_url=http://archive.apache.org/dist/apr/apr-${apr_ver}.tar.gz && Download_src
       src_url=http://archive.apache.org/dist/apr/apr-util-${apr_util_ver}.tar.gz && Download_src
       src_url=http://mirrors.linuxeye.com/apache/httpd/nghttp2-${nghttp2_ver}.tar.gz && Download_src
-    fi
-    if [ "${apache_option}" == '2' ]; then
+      ;;
+    2)
       echo "Download apache 2.2..."
       src_url=http://archive.apache.org/dist/httpd/httpd-${apache22_ver}.tar.gz && Download_src
-
       echo "Download mod_remoteip.c for apache 2.2..."
       src_url=${mirrorLink}/mod_remoteip.c && Download_src
-    fi
+      ;;
+  esac
+
+  # tomcat
+  case "${tomcat_option}" in
+    1)
+      echo "Download tomcat 9..."
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat9_ver}/apache-tomcat-${tomcat9_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat9_ver}/catalina-jmx-remote.jar && Download_src
+      ;;
+    2)
+      echo "Download tomcat 8..."
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat8_ver}/apache-tomcat-${tomcat8_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat8_ver}/catalina-jmx-remote.jar && Download_src
+      ;;
+    3)
+      echo "Download tomcat 7..."
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat7_ver}/apache-tomcat-${tomcat7_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat7_ver}/catalina-jmx-remote.jar && Download_src
+      ;;
+    4)
+      echo "Download tomcat 6..."
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat6_ver}/apache-tomcat-${tomcat6_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat6_ver}/catalina-jmx-remote.jar && Download_src
+      ;;
+  esac
 
-    # tomcat
-    case "${tomcat_option}" in
+  # jdk
+  if [[ "${jdk_option}"  =~ ^[1-4]$ ]]; then
+    case "${jdk_option}" in
       1)
-        echo "Download tomcat 9..."
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat9_ver}/apache-tomcat-${tomcat9_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat9_ver}/catalina-jmx-remote.jar && Download_src
+        echo "Download JDK 11.0..."
+        JDK_FILE="jdk-${jdk110_ver}_linux-${SYS_BIT_j}_bin.tar.gz"
         ;;
       2)
-        echo "Download tomcat 8..."
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat8_ver}/apache-tomcat-${tomcat8_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat8_ver}/catalina-jmx-remote.jar && Download_src
+        echo "Download JDK 1.8..."
+        JDK_FILE="jdk-$(echo ${jdk18_ver} | awk -F. '{print $2}')u$(echo ${jdk18_ver} | awk -F_ '{print $NF}')-linux-${SYS_BIT_j}.tar.gz"
         ;;
       3)
-        echo "Download tomcat 7..."
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat7_ver}/apache-tomcat-${tomcat7_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat7_ver}/catalina-jmx-remote.jar && Download_src
+        echo "Download JDK 1.7..."
+        JDK_FILE="jdk-$(echo ${jdk17_ver} | awk -F. '{print $2}')u$(echo ${jdk17_ver} | awk -F_ '{print $NF}')-linux-${SYS_BIT_j}.tar.gz"
         ;;
       4)
-        echo "Download tomcat 6..."
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat6_ver}/apache-tomcat-${tomcat6_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/apache/tomcat/v${tomcat6_ver}/catalina-jmx-remote.jar && Download_src
+        echo "Download JDK 1.6..."
+        JDK_FILE="jdk-$(echo ${jdk16_ver} | awk -F. '{print $2}')u$(echo ${jdk16_ver} | awk -F_ '{print $NF}')-linux-${SYS_BIT_j}.bin"
         ;;
     esac
-
-    if [[ "${jdk_option}"  =~ ^[1-4]$ ]]; then
-      case "${jdk_option}" in
-        1)
-          echo "Download JDK 11.0..."
-          JDK_FILE="jdk-${jdk110_ver}_linux-${SYS_BIT_j}_bin.tar.gz"
-          ;;
-        2)
-          echo "Download JDK 1.8..."
-          JDK_FILE="jdk-$(echo ${jdk18_ver} | awk -F. '{print $2}')u$(echo ${jdk18_ver} | awk -F_ '{print $NF}')-linux-${SYS_BIT_j}.tar.gz"
-          ;;
-        3)
-          echo "Download JDK 1.7..."
-          JDK_FILE="jdk-$(echo ${jdk17_ver} | awk -F. '{print $2}')u$(echo ${jdk17_ver} | awk -F_ '{print $NF}')-linux-${SYS_BIT_j}.tar.gz"
-          ;;
-        4)
-          echo "Download JDK 1.6..."
-          JDK_FILE="jdk-$(echo ${jdk16_ver} | awk -F. '{print $2}')u$(echo ${jdk16_ver} | awk -F_ '{print $NF}')-linux-${SYS_BIT_j}.bin"
-          ;;
-      esac
-      src_url=http://mirrors.linuxeye.com/jdk/${JDK_FILE} && Download_src
-      echo "Download apr..."
-      src_url=http://archive.apache.org/dist/apr/apr-${apr_ver}.tar.gz && Download_src
-    fi
+    src_url=http://mirrors.linuxeye.com/jdk/${JDK_FILE} && Download_src
+    echo "Download apr..."
+    src_url=http://archive.apache.org/dist/apr/apr-${apr_ver}.tar.gz && Download_src
   fi
 
-  if [ "${db_yn}" == 'y' ]; then
+  if [[ "${db_option}" =~ ^[1-9]$|^1[0-5]$ ]]; then
     if [[ "${db_option}" =~ ^[1,2,5,6,9]$ ]] && [ "${dbinstallmethod}" == "2" ]; then
       [[ "${db_option}" =~ ^[2,5,6,9]$ ]] && boost_ver=${boost_oldver}
       echo "Download boost..."
@@ -619,54 +620,53 @@ checkDownload() {
   fi
 
   # PHP
-  if [ "${php_yn}" == 'y' ]; then
-    # php 5.3 5.4 5.5 5.6 5.7
+  if [[ "${php_option}" =~ ^[1-8]$ ]]; then
     echo "PHP common..."
     src_url=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${libiconv_ver}.tar.gz && Download_src
+    src_url=${mirrorLink}/libiconv-glibc-2.16.patch && Download_src
     src_url=https://curl.haxx.se/download/curl-${curl_ver}.tar.gz && Download_src
-    src_url=http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/${libmcrypt_ver}/libmcrypt-${libmcrypt_ver}.tar.gz && Download_src
     src_url=http://downloads.sourceforge.net/project/mhash/mhash/${mhash_ver}/mhash-${mhash_ver}.tar.gz && Download_src
+    src_url=http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/${libmcrypt_ver}/libmcrypt-${libmcrypt_ver}.tar.gz && Download_src
     src_url=http://downloads.sourceforge.net/project/mcrypt/MCrypt/${mcrypt_ver}/mcrypt-${mcrypt_ver}.tar.gz && Download_src
-    src_url=${mirrorLink}/libiconv-glibc-2.16.patch && Download_src
-
-    case "${php_option}" in
-      1)
-        # php 5.3
-        src_url=${mirrorLink}/debian_patches_disable_SSLv2_for_openssl_1_0_0.patch && Download_src
-        src_url=${mirrorLink}/php5.3patch && Download_src
-        src_url=http://www.php.net/distributions/php-${php53_ver}.tar.gz && Download_src
-        src_url=${mirrorLink}/fpm-race-condition.patch && Download_src
-        ;;
-      2)
-        src_url=http://www.php.net/distributions/php-${php54_ver}.tar.gz && Download_src
-        src_url=${mirrorLink}/fpm-race-condition.patch && Download_src
-        ;;
-      3)
-        src_url=http://www.php.net/distributions/php-${php55_ver}.tar.gz && Download_src
-        src_url=${mirrorLink}/fpm-race-condition.patch && Download_src
-        ;;
-      4)
-        src_url=http://www.php.net/distributions/php-${php56_ver}.tar.gz && Download_src
-        ;;
-      5)
-        src_url=http://www.php.net/distributions/php-${php70_ver}.tar.gz && Download_src
-        ;;
-      6)
-        src_url=http://www.php.net/distributions/php-${php71_ver}.tar.gz && Download_src
-        ;;
-      7)
-        src_url=http://www.php.net/distributions/php-${php72_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
-        ;;
-      8)
-        src_url=http://www.php.net/distributions/php-${php73_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
-        ;;
-    esac
   fi
 
+  case "${php_option}" in
+    1)
+      # php 5.3
+      src_url=${mirrorLink}/debian_patches_disable_SSLv2_for_openssl_1_0_0.patch && Download_src
+      src_url=${mirrorLink}/php5.3patch && Download_src
+      src_url=http://www.php.net/distributions/php-${php53_ver}.tar.gz && Download_src
+      src_url=${mirrorLink}/fpm-race-condition.patch && Download_src
+      ;;
+    2)
+      src_url=http://www.php.net/distributions/php-${php54_ver}.tar.gz && Download_src
+      src_url=${mirrorLink}/fpm-race-condition.patch && Download_src
+      ;;
+    3)
+      src_url=http://www.php.net/distributions/php-${php55_ver}.tar.gz && Download_src
+      src_url=${mirrorLink}/fpm-race-condition.patch && Download_src
+      ;;
+    4)
+      src_url=http://www.php.net/distributions/php-${php56_ver}.tar.gz && Download_src
+      ;;
+    5)
+      src_url=http://www.php.net/distributions/php-${php70_ver}.tar.gz && Download_src
+      ;;
+    6)
+      src_url=http://www.php.net/distributions/php-${php71_ver}.tar.gz && Download_src
+      ;;
+    7)
+      src_url=http://www.php.net/distributions/php-${php72_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
+      ;;
+    8)
+      src_url=http://www.php.net/distributions/php-${php73_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
+      ;;
+  esac
+
   # PHP OPCache
   case "${phpcache_option}" in
     1)
@@ -768,7 +768,7 @@ checkDownload() {
   fi
 
   # redis-server
-  if [ "${redis_yn}" == 'y' ]; then
+  if [ "${redis_flag}" == 'y' ]; then
     echo "Download redis-server..."
     src_url=http://download.redis.io/releases/redis-${redis_ver}.tar.gz && Download_src
     if [ "${PM}" == 'yum' ]; then
@@ -784,7 +784,7 @@ checkDownload() {
   fi
 
   # memcached-server
-  if [ "${memcached_yn}" == 'y' ]; then
+  if [ "${memcached_flag}" == 'y' ]; then
     echo "Download memcached-server..."
     [ "${IPADDR_COUNTRY}"x == "CN"x ] && DOWN_ADDR=${mirrorLink} || DOWN_ADDR=http://www.memcached.org/files
     src_url=${DOWN_ADDR}/memcached-${memcached_ver}.tar.gz && Download_src
@@ -824,13 +824,13 @@ checkDownload() {
   fi
 
   # pureftpd
-  if [ "${ftp_yn}" == 'y' ]; then
+  if [ "${pureftpd_flag}" == 'y' ]; then
     echo "Download pureftpd..."
     src_url=https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${pureftpd_ver}.tar.gz && Download_src
   fi
 
   # phpMyAdmin
-  if [ "${phpmyadmin_yn}" == 'y' ]; then
+  if [ "${phpmyadmin_flag}" == 'y' ]; then
     echo "Download phpMyAdmin..."
     if [[ "${php_option}" =~ ^[1-2]$ ]]; then
       src_url=https://files.phpmyadmin.net/phpMyAdmin/${phpmyadmin_oldver}/phpMyAdmin-${phpmyadmin_oldver}-all-languages.tar.gz && Download_src

+ 1 - 1
include/check_sw.sh

@@ -53,7 +53,7 @@ installDepsCentOS() {
   if [ "${CentOS_ver}" == '7' ]; then
     yum -y groupremove "Basic Web Server" "MySQL Database server" "MySQL Database client"
     systemctl mask firewalld.service
-    if [ "${iptables_yn}" == 'y' ]; then
+    if [ "${iptables_flag}" == 'y' ]; then
       yum -y install iptables-services
       systemctl enable iptables.service
       systemctl enable ip6tables.service

+ 1 - 1
include/init_CentOS.sh

@@ -114,7 +114,7 @@ ntpdate pool.ntp.org
 [ ! -e "/var/spool/cron/root" -o -z "$(grep 'ntpdate' /var/spool/cron/root)" ] && { echo "*/20 * * * * $(which ntpdate) pool.ntp.org > /dev/null 2>&1" >> /var/spool/cron/root;chmod 600 /var/spool/cron/root; }
 
 # iptables
-if [ "${iptables_yn}" == 'y' ]; then
+if [ "${iptables_flag}" == 'y' ]; then
   if [ -e "/etc/sysconfig/iptables" ] && [ -n "$(grep '^:INPUT DROP' /etc/sysconfig/iptables)" -a -n "$(grep 'NEW -m tcp --dport 22 -j ACCEPT' /etc/sysconfig/iptables)" -a -n "$(grep 'NEW -m tcp --dport 80 -j ACCEPT' /etc/sysconfig/iptables)" ]; then
     IPTABLES_STATUS=yes
   else

+ 1 - 1
include/init_Debian.sh

@@ -89,7 +89,7 @@ ntpdate pool.ntp.org
 [ ! -e "/var/spool/cron/crontabs/root" -o -z "$(grep ntpdate /var/spool/cron/crontabs/root 2>/dev/null)" ] && { echo "*/20 * * * * $(which ntpdate) pool.ntp.org > /dev/null 2>&1" >> /var/spool/cron/crontabs/root;chmod 600 /var/spool/cron/crontabs/root; }
 
 # iptables
-if [ "${iptables_yn}" == 'y' ]; then
+if [ "${iptables_flag}" == 'y' ]; then
   apt-get -y install debconf-utils
   echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
   echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections

+ 1 - 1
include/init_Ubuntu.sh

@@ -97,7 +97,7 @@ ntpdate pool.ntp.org
 [ ! -e "/var/spool/cron/crontabs/root" -o -z "$(grep ntpdate /var/spool/cron/crontabs/root 2>/dev/null)" ] && { echo "*/20 * * * * $(which ntpdate) pool.ntp.org > /dev/null 2>&1" >> /var/spool/cron/crontabs/root;chmod 600 /var/spool/cron/crontabs/root; }
 
 # iptables
-if [ "${iptables_yn}" == 'y' ]; then
+if [ "${iptables_flag}" == 'y' ]; then
   apt-get -y install debconf-utils
   echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
   echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections

+ 1 - 1
include/nginx.sh

@@ -62,7 +62,7 @@ Install_Nginx() {
     /bin/cp ../config/nginx_tomcat.conf ${nginx_install_dir}/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${nginx_install_dir}/conf/nginx.conf
-    [ "${php_yn}" == 'y' ] && [ -z "`grep '/php-fpm_status' ${nginx_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${nginx_install_dir}/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-8]$ ]] && [ -z "`grep '/php-fpm_status' ${nginx_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${nginx_install_dir}/conf/nginx.conf
   fi
   cat > ${nginx_install_dir}/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 1 - 1
include/openresty.sh

@@ -58,7 +58,7 @@ Install_OpenResty() {
     /bin/cp ../config/nginx_tomcat.conf ${openresty_install_dir}/nginx/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${openresty_install_dir}/nginx/conf/nginx.conf
-    [ "${php_yn}" == 'y' ] && [ -z "`grep '/php-fpm_status' ${openresty_install_dir}/nginx/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${openresty_install_dir}/nginx/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-8]$ ]] && [ -z "`grep '/php-fpm_status' ${openresty_install_dir}/nginx/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${openresty_install_dir}/nginx/conf/nginx.conf
   fi
   cat > ${openresty_install_dir}/nginx/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 0 - 1
include/php-5.3.sh

@@ -245,7 +245,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-5.4.sh

@@ -240,7 +240,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-5.5.sh

@@ -253,7 +253,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-5.6.sh

@@ -256,7 +256,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-7.0.sh

@@ -262,7 +262,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-7.1.sh

@@ -262,7 +262,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-7.2.sh

@@ -255,7 +255,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 0 - 1
include/php-7.3.sh

@@ -255,7 +255,6 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    #[ "$web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" ${php_install_dir}/etc/php-fpm.conf
     service php-fpm start
 
   elif [ "${apache_option}" == '2' ] || [ "${Apache_flag}" == '22' ]; then

+ 1 - 1
include/tengine.sh

@@ -60,7 +60,7 @@ Install_Tengine() {
     /bin/cp ../config/nginx_tomcat.conf ${tengine_install_dir}/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${tengine_install_dir}/conf/nginx.conf
-    [ "${php_yn}" == 'y' ] && [ -z "`grep '/php-fpm_status' ${tengine_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${tengine_install_dir}/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-8]$ ]] && [ -z "`grep '/php-fpm_status' ${tengine_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${tengine_install_dir}/conf/nginx.conf
   fi
   cat > ${tengine_install_dir}/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 75 - 77
install.sh

@@ -84,7 +84,6 @@ while :; do
     --nginx_option)
       nginx_option=$2; shift 2
       [[ ! ${nginx_option} =~ ^[1-3]$ ]] && { echo "${CWARNING}nginx_option input error! Please only input number 1~3${CEND}"; exit 1; }
-      web_yn=y
       [ -e "${nginx_install_dir}/sbin/nginx" ] && { echo "${CWARNING}Nginx already installed! ${CEND}"; unset nginx_option; }
       [ -e "${tengine_install_dir}/sbin/nginx" ] && { echo "${CWARNING}Tengine already installed! ${CEND}"; unset nginx_option; }
       [ -e "${openresty_install_dir}/nginx/sbin/nginx" ] && { echo "${CWARNING}OpenResty already installed! ${CEND}"; unset nginx_option; }
@@ -92,20 +91,17 @@ while :; do
     --apache_option)
       apache_option=$2; shift 2
       [[ ! ${apache_option} =~ ^[1-2]$ ]] && { echo "${CWARNING}apache_option input error! Please only input number 1~2${CEND}"; exit 1; }
-      web_yn=y
       [ -e "${apache_install_dir}/bin/httpd" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; unset apache_option; }
       ;;
     --php_option)
       php_option=$2; shift 2
       [[ ! ${php_option} =~ ^[1-8]$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~8${CEND}"; exit 1; }
-      php_yn=y
       [ -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP already installed! ${CEND}"; unset php_option; }
       ;;
     --php_vn)
-      php_vn=$2; shift 2
+      php_vn=$2; mphp_flag=y; shift 2
       [[ "${php_vn}" =~ ^5[3-6]$|^7[0-3]$ ]] && { echo "${CWARNING}php_vn input error! Please only input number 53~73${CEND}"; exit 1; }
-      mphp_yn=y; php_yn=y
-      [ -e "${php_install_dir}${php_vn}/bin/phpize" ] && { echo "${CWARNING}PHP${php_vn} already installed! ${CEND}"; unset php_vn; }
+      [ -e "${php_install_dir}${php_vn}/bin/phpize" ] && { echo "${CWARNING}PHP${php_vn} already installed! ${CEND}"; unset php_vn mphp_flag; }
       ;;
     --phpcache_option)
       phpcache_option=$2; shift 2
@@ -130,7 +126,6 @@ while :; do
     --tomcat_option)
       tomcat_option=$2; shift 2
       [[ ! ${tomcat_option} =~ ^[1-4]$ ]] && { echo "${CWARNING}tomcat_option input error! Please only input number 1~4${CEND}"; exit 1; }
-      web_yn=y
       [ -e "$tomcat_install_dir/conf/server.xml" ] && { echo "${CWARNING}Tomcat already installed! ${CEND}" ; unset tomcat_option; }
       ;;
     --jdk_option)
@@ -139,7 +134,6 @@ while :; do
       ;;
     --db_option)
       db_option=$2; shift 2
-      db_yn=y
       if [[ "${db_option}" =~ ^[1-9]$|^1[0-3]$ ]]; then
         [ -d "${db_install_dir}/support-files" ] && { echo "${CWARNING}MySQL already installed! ${CEND}"; unset db_option; }
       elif [ "${db_option}" == '14' ]; then
@@ -161,34 +155,34 @@ while :; do
       [[ ! ${dbinstallmethod} =~ ^[1-2]$ ]] && { echo "${CWARNING}dbinstallmethod input error! Please only input number 1~2${CEND}"; exit 1; }
       ;;
     --pureftpd)
-      ftp_yn=y; shift 1
-      [ -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ] && { echo "${CWARNING}Pure-FTPd already installed! ${CEND}"; unset ftp_yn; }
+      pureftpd_flag=y; shift 1
+      [ -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ] && { echo "${CWARNING}Pure-FTPd already installed! ${CEND}"; unset pureftpd_flag; }
       ;;
     --redis)
-      redis_yn=y; shift 1
-      [ -e "${redis_install_dir}/bin/redis-server" ] && { echo "${CWARNING}redis-server already installed! ${CEND}"; unset redis_yn; }
+      redis_flag=y; shift 1
+      [ -e "${redis_install_dir}/bin/redis-server" ] && { echo "${CWARNING}redis-server already installed! ${CEND}"; unset redis_flag; }
       ;;
     --memcached)
-      memcached_yn=y; shift 1
-      [ -e "${memcached_install_dir}/bin/memcached" ] && { echo "${CWARNING}memcached-server already installed! ${CEND}"; unset memcached_yn; }
+      memcached_flag=y; shift 1
+      [ -e "${memcached_install_dir}/bin/memcached" ] && { echo "${CWARNING}memcached-server already installed! ${CEND}"; unset memcached_flag; }
       ;;
     --phpmyadmin)
-      phpmyadmin_yn=y; shift 1
-      [ -d "${wwwroot_dir}/default/phpMyAdmin" ] && { echo "${CWARNING}phpMyAdmin already installed! ${CEND}"; unset phpmyadmin_yn; }
+      phpmyadmin_flag=y; shift 1
+      [ -d "${wwwroot_dir}/default/phpMyAdmin" ] && { echo "${CWARNING}phpMyAdmin already installed! ${CEND}"; unset phpmyadmin_flag; }
       ;;
     --hhvm)
-      hhvm_yn=y; shift 1
-      [ -e "/usr/bin/hhvm" ] && { echo "${CWARNING}HHVM already installed! ${CEND}"; unset hhvm_yn; }
+      hhvm_flag=y; shift 1
+      [ -e "/usr/bin/hhvm" ] && { echo "${CWARNING}HHVM already installed! ${CEND}"; unset hhvm_flag; }
       ;;
     --ssh_port)
       ssh_port=$2; shift 2
-      ssh_port_yn=y
+      ssh_port_flag=y
       ;;
     --iptables)
-      iptables_yn=y; shift 1
+      iptables_flag=y; shift 1
       ;;
     --reboot)
-      reboot_yn=y; shift 1
+      reboot_flag=y; shift 1
       ;;
     --)
       shift
@@ -207,7 +201,7 @@ done
 if [ -e "/etc/ssh/sshd_config" ]; then
   [ -z "`grep ^Port /etc/ssh/sshd_config`" ] && now_ssh_port=22 || now_ssh_port=`grep ^Port /etc/ssh/sshd_config | awk '{print $2}' | head -1`
   while :; do echo
-    [ "${ssh_port_yn}" != 'y' ] && read -e -p "Please input SSH port(Default: ${now_ssh_port}): " ssh_port
+    [ "${ssh_port_flag}" != 'y' ] && read -e -p "Please input SSH port(Default: ${now_ssh_port}): " ssh_port
     ssh_port=${ssh_port:-${now_ssh_port}}
     if [ ${ssh_port} -eq 22 >/dev/null 2>&1 -o ${ssh_port} -gt 1024 >/dev/null 2>&1 -a ${ssh_port} -lt 65535 >/dev/null 2>&1 ]; then
       break
@@ -227,8 +221,8 @@ if [ ${ARG_NUM} == 0 ]; then
   if [ ! -e ~/.oneinstack ]; then
     # check iptables
     while :; do echo
-      read -e -p "Do you want to enable iptables? [y/n]: " iptables_yn
-      if [[ ! ${iptables_yn} =~ ^[y,n]$ ]]; then
+      read -e -p "Do you want to enable iptables? [y/n]: " iptables_flag
+      if [[ ! ${iptables_flag} =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
       else
         break
@@ -238,11 +232,11 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check Web server
   while :; do echo
-    read -e -p "Do you want to install Web server? [y/n]: " web_yn
-    if [[ ! ${web_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install Web server? [y/n]: " web_flag
+    if [[ ! ${web_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      if [ "${web_yn}" == 'y' ]; then
+      if [ "${web_flag}" == 'y' ]; then
         # Nginx/Tegine/OpenResty
         while :; do echo
           echo 'Please select Nginx server:'
@@ -355,11 +349,11 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # choice database
   while :; do echo
-    read -e -p "Do you want to install Database? [y/n]: " db_yn
-    if [[ ! ${db_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install Database? [y/n]: " db_flag
+    if [[ ! ${db_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      if [ "${db_yn}" == 'y' ]; then
+      if [ "${db_flag}" == 'y' ]; then
         while :; do echo
           echo 'Please select a version of the Database:'
           echo -e "\t${CMSG} 1${CEND}. Install MySQL-8.0"
@@ -441,11 +435,11 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # choice php
   while :; do echo
-    read -e -p "Do you want to install PHP? [y/n]: " php_yn
-    if [[ ! ${php_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install PHP? [y/n]: " php_flag
+    if [[ ! ${php_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      if [ "${php_yn}" == 'y' ]; then
+      if [ "${php_flag}" == 'y' ]; then
         [ -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP already installed! ${CEND}"; unset php_option; break; }
         while :; do echo
           echo 'Please select a version of the PHP:'
@@ -479,11 +473,11 @@ if [ ${ARG_NUM} == 0 ]; then
   # PHP opcode cache and extensions
   if [[ ${php_option} =~ ^[1-8]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
-      read -e -p "Do you want to install opcode cache of the PHP? [y/n]: " phpcache_yn
-      if [[ ! ${phpcache_yn} =~ ^[y,n]$ ]]; then
+      read -e -p "Do you want to install opcode cache of the PHP? [y/n]: " phpcache_flag
+      if [[ ! ${phpcache_flag} =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
       else
-        if [ "${phpcache_yn}" == 'y' ]; then
+        if [ "${phpcache_flag}" == 'y' ]; then
           if [ "${php_option}" == '1' -o "${PHP_main_ver}" == '5.3' ]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
@@ -625,11 +619,11 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check Pureftpd
   while :; do echo
-    read -e -p "Do you want to install Pure-FTPd? [y/n]: " ftp_yn
-    if [[ ! ${ftp_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install Pure-FTPd? [y/n]: " pureftpd_flag
+    if [[ ! ${pureftpd_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      [ "${ftp_yn}" == 'y' -a -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ] && { echo "${CWARNING}Pure-FTPd already installed! ${CEND}"; unset ftp_yn; }
+      [ "${pureftpd_flag}" == 'y' -a -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ] && { echo "${CWARNING}Pure-FTPd already installed! ${CEND}"; unset pureftpd_flag; }
       break
     fi
   done
@@ -637,11 +631,11 @@ if [ ${ARG_NUM} == 0 ]; then
   # check phpMyAdmin
   if [[ ${php_option} =~ ^[1-8]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
-      read -e -p "Do you want to install phpMyAdmin? [y/n]: " phpmyadmin_yn
-      if [[ ! ${phpmyadmin_yn} =~ ^[y,n]$ ]]; then
+      read -e -p "Do you want to install phpMyAdmin? [y/n]: " phpmyadmin_flag
+      if [[ ! ${phpmyadmin_flag} =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
       else
-        [ "${phpmyadmin_yn}" == 'y' -a -d "${wwwroot_dir}/default/phpMyAdmin" ] && { echo "${CWARNING}phpMyAdmin already installed! ${CEND}"; unset phpmyadmin_yn; }
+        [ "${phpmyadmin_flag}" == 'y' -a -d "${wwwroot_dir}/default/phpMyAdmin" ] && { echo "${CWARNING}phpMyAdmin already installed! ${CEND}"; unset phpmyadmin_flag; }
         break
       fi
     done
@@ -649,33 +643,33 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check redis
   while :; do echo
-    read -e -p "Do you want to install redis-server? [y/n]: " redis_yn
-    if [[ ! ${redis_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install redis-server? [y/n]: " redis_flag
+    if [[ ! ${redis_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      [ "${redis_yn}" == 'y' -a -e "${redis_install_dir}/bin/redis-server" ] && { echo "${CWARNING}redis-server already installed! ${CEND}"; unset redis_yn; }
+      [ "${redis_flag}" == 'y' -a -e "${redis_install_dir}/bin/redis-server" ] && { echo "${CWARNING}redis-server already installed! ${CEND}"; unset redis_flag; }
       break
     fi
   done
 
   # check memcached
   while :; do echo
-    read -e -p "Do you want to install memcached-server? [y/n]: " memcached_yn
-    if [[ ! ${memcached_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install memcached-server? [y/n]: " memcached_flag
+    if [[ ! ${memcached_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      [ "${memcached_yn}" == 'y' -a -e "${memcached_install_dir}/bin/memcached" ] && { echo "${CWARNING}memcached-server already installed! ${CEND}"; unset memcached_yn; }
+      [ "${memcached_flag}" == 'y' -a -e "${memcached_install_dir}/bin/memcached" ] && { echo "${CWARNING}memcached-server already installed! ${CEND}"; unset memcached_flag; }
       break
     fi
   done
 
   while :; do echo
-    read -e -p "Do you want to install HHVM? [y/n]: " hhvm_yn
-    if [[ ! ${hhvm_yn} =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to install HHVM? [y/n]: " hhvm_flag
+    if [[ ! ${hhvm_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-      if [ "${hhvm_yn}" == 'y' ]; then
-        [ -e "/usr/bin/hhvm" ] && { echo "${CWARNING}HHVM already installed! ${CEND}"; unset hhvm_yn; break; }
+      if [ "${hhvm_flag}" == 'y' ]; then
+        [ -e "/usr/bin/hhvm" ] && { echo "${CWARNING}HHVM already installed! ${CEND}"; unset hhvm_flag; break; }
         if [ "${PM}" == 'yum' -a "${OS_BIT}" == '64' ] && [ -n "`grep -E ' 7\.| 6\.[5-9]' /etc/redhat-release`" ]; then
           break
         else
@@ -683,7 +677,7 @@ if [ ${ARG_NUM} == 0 ]; then
           echo "${CWARNING}HHVM only support CentOS6.5+ 64bit, CentOS7 64bit! ${CEND}"
           echo "Press Ctrl+c to cancel or Press any key to continue..."
           char=`get_char`
-          unset hhvm_yn
+          unset hhvm_flag
         fi
       fi
       break
@@ -737,7 +731,7 @@ fi
 startTime=`date +%s`
 
 # Jemalloc
-if [[ ${nginx_option} =~ ^[1-3]$ ]] || [ "${db_yn}" == 'y' ]; then
+if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-5]$ ]]; then
   . include/jemalloc.sh
   Install_Jemalloc | tee -a ${oneinstack_dir}/install.log
 fi
@@ -1026,40 +1020,42 @@ case "${tomcat_option}" in
 esac
 
 # Pure-FTPd
-if [ "${ftp_yn}" == 'y' ]; then
+if [ "${pureftpd_flag}" == 'y' ]; then
   . include/pureftpd.sh
   Install_PureFTPd 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # phpMyAdmin
-if [ "${phpmyadmin_yn}" == 'y' ]; then
+if [ "${phpmyadmin_flag}" == 'y' ]; then
   . include/phpmyadmin.sh
   Install_phpMyAdmin 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # redis
-if [ "${redis_yn}" == 'y' ]; then
+if [ "${redis_flag}" == 'y' ]; then
   . include/redis.sh
   Install_redis_server 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # memcached
-if [ "${memcached_yn}" == 'y' ]; then
+if [ "${memcached_flag}" == 'y' ]; then
   . include/memcached.sh
   Install_memcached_server 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # index example
-if [ ! -e "${wwwroot_dir}/default/index.html" -a "${web_yn}" == 'y' ]; then
-  . include/demo.sh
-  DEMO 2>&1 | tee -a ${oneinstack_dir}/install.log
+if [ ! -e "${wwwroot_dir}/default/index.html" ]; then
+  if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ ${apache_option} =~ ^[1-2]$ ]] || [[ ${tomcat_option} =~ ^[1-4]$ ]]; then
+    . include/demo.sh
+    DEMO 2>&1 | tee -a ${oneinstack_dir}/install.log
+  fi
 fi
 
 # get web_install_dir and db_install_dir
 . include/check_dir.sh
 
 # HHVM
-if [ "${hhvm_yn}" == 'y' ] && [ "${PM}" == 'yum' -a "${OS_BIT}" == '64' ] && [ -n "`grep -E ' 7\.| 6\.[5-9]' /etc/redhat-release`" ]; then
+if [ "${hhvm_flag}" == '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
@@ -1076,9 +1072,9 @@ endTime=`date +%s`
 ((installTime=($endTime-$startTime)/60))
 echo "####################Congratulations########################"
 echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
-[ "${web_yn}" == 'y' ] && [[ "${nginx_option}" =~ ^[1-3]$ ]] && echo -e "\n$(printf "%-32s" "Nginx install dir":)${CMSG}${web_install_dir}${CEND}"
-[ "${web_yn}" == 'y' ] && [[ "${apache_option}" =~ ^[1,2]$ ]] && echo -e "\n$(printf "%-32s" "Apache install dir":)${CMSG}${apache_install_dir}${CEND}"
-[[ "${tomcat_option}" =~ ^[1,2]$ ]] && echo -e "\n$(printf "%-32s" "Tomcat install dir":)${CMSG}${tomcat_install_dir}${CEND}"
+[[ "${nginx_option}" =~ ^[1-3]$ ]] && echo -e "\n$(printf "%-32s" "Nginx install dir":)${CMSG}${web_install_dir}${CEND}"
+[[ "${apache_option}" =~ ^[1-2]$ ]] && echo -e "\n$(printf "%-32s" "Apache install dir":)${CMSG}${apache_install_dir}${CEND}"
+[[ "${tomcat_option}" =~ ^[1-4]$ ]] && echo -e "\n$(printf "%-32s" "Tomcat install dir":)${CMSG}${tomcat_install_dir}${CEND}"
 [[ "${db_option}" =~ ^[1-9]$|^1[0-3]$ ]] && echo -e "\n$(printf "%-32s" "Database install dir:")${CMSG}${db_install_dir}${CEND}"
 [[ "${db_option}" =~ ^[1-9]$|^1[0-3]$ ]] && echo "$(printf "%-32s" "Database data dir:")${CMSG}${db_data_dir}${CEND}"
 [[ "${db_option}" =~ ^[1-9]$|^1[0-3]$ ]] && echo "$(printf "%-32s" "Database user:")${CMSG}root${CEND}"
@@ -1091,8 +1087,8 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${db_option}" == '15' ] && echo "$(printf "%-32s" "MongoDB data dir:")${CMSG}${mongo_data_dir}${CEND}"
 [ "${db_option}" == '15' ] && echo "$(printf "%-32s" "MongoDB user:")${CMSG}root${CEND}"
 [ "${db_option}" == '15' ] && echo "$(printf "%-32s" "MongoDB password:")${CMSG}${dbmongopwd}${CEND}"
-[ "${php_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
-[ "${php_yn}" == 'y' -a "${phpcache_option}" == '1' ] && echo "$(printf "%-32s" "Opcache Control Panel URL:")${CMSG}http://${IPADDR}/ocp.php${CEND}"
+[[ "${php_option}" =~ ^[1-8]$ ]] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
+[[ "${php_option}" =~ ^[1-8]$ ]] && [ "${phpcache_option}" == '1' ] && echo "$(printf "%-32s" "Opcache Control Panel URL:")${CMSG}http://${IPADDR}/ocp.php${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache Control Panel URL:")${CMSG}http://${IPADDR}/xcache${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache user:")${CMSG}admin${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache password:")${CMSG}${xcachepwd}${CEND}"
@@ -1100,22 +1096,24 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${phpcache_option}" == '4' -a -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ] && echo "$(printf "%-32s" "eAccelerator Control Panel URL:")${CMSG}http://${IPADDR}/control.php${CEND}"
 [ "${phpcache_option}" == '4' -a -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ] && echo "$(printf "%-32s" "eAccelerator user:")${CMSG}admin${CEND}"
 [ "${phpcache_option}" == '4' -a -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ] && echo "$(printf "%-32s" "eAccelerator password:")${CMSG}eAccelerator${CEND}"
-[ "${ftp_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "Pure-FTPd install dir:")${CMSG}${pureftpd_install_dir}${CEND}"
-[ "${ftp_yn}" == 'y' ] && echo "$(printf "%-32s" "Create FTP virtual script:")${CMSG}./pureftpd_vhost.sh${CEND}"
-[ "${phpmyadmin_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "phpMyAdmin dir:")${CMSG}${wwwroot_dir}/default/phpMyAdmin${CEND}"
-[ "${phpmyadmin_yn}" == 'y' ] && echo "$(printf "%-32s" "phpMyAdmin Control Panel URL:")${CMSG}http://${IPADDR}/phpMyAdmin${CEND}"
-[ "${redis_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "redis install dir:")${CMSG}${redis_install_dir}${CEND}"
-[ "${memcached_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "memcached install dir:")${CMSG}${memcached_install_dir}${CEND}"
-[ "${web_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "Index URL:")${CMSG}http://${IPADDR}/${CEND}"
+[ "${pureftpd_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "Pure-FTPd install dir:")${CMSG}${pureftpd_install_dir}${CEND}"
+[ "${pureftpd_flag}" == 'y' ] && echo "$(printf "%-32s" "Create FTP virtual script:")${CMSG}./pureftpd_vhost.sh${CEND}"
+[ "${phpmyadmin_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "phpMyAdmin dir:")${CMSG}${wwwroot_dir}/default/phpMyAdmin${CEND}"
+[ "${phpmyadmin_flag}" == 'y' ] && echo "$(printf "%-32s" "phpMyAdmin Control Panel URL:")${CMSG}http://${IPADDR}/phpMyAdmin${CEND}"
+[ "${redis_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "redis install dir:")${CMSG}${redis_install_dir}${CEND}"
+[ "${memcached_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "memcached install dir:")${CMSG}${memcached_install_dir}${CEND}"
+if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ ${apache_option} =~ ^[1-2]$ ]] || [[ ${tomcat_option} =~ ^[1-4]$ ]]; then
+  echo -e "\n$(printf "%-32s" "Index URL:")${CMSG}http://${IPADDR}/${CEND}"
+fi
 if [ ${ARG_NUM} == 0 ]; then
   while :; do echo
     echo "${CMSG}Please restart the server and see if the services start up fine.${CEND}"
-    read -e -p "Do you want to restart OS ? [y/n]: " reboot_yn
-    if [[ ! "${reboot_yn}" =~ ^[y,n]$ ]]; then
+    read -e -p "Do you want to restart OS ? [y/n]: " reboot_flag
+    if [[ ! "${reboot_flag}" =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
       break
     fi
   done
 fi
-[ "${reboot_yn}" == 'y' ] && reboot
+[ "${reboot_flag}" == 'y' ] && reboot

+ 6 - 6
reset_db_root_password.sh

@@ -44,10 +44,10 @@ while :; do
       Show_Help; exit 0
       ;;
     -q|--quiet)
-      quiet_yn=y; shift 1
+      quiet_flag=y; shift 1
       ;;
     -f|--force)
-      force_yn=y; shift 1
+      force_flag=y; shift 1
       ;;
     -p|--password)
       New_dbrootpwd=$2; shift 2
@@ -126,9 +126,9 @@ EOF
   fi
 }
 
-[ "${password_flag}" == 'y' ] && quiet_yn=y
-if [ "${quiet_yn}" == 'y' ]; then
-  if [ "${force_yn}" == 'y' ]; then
+[ "${password_flag}" == 'y' ] && quiet_flag=y
+if [ "${quiet_flag}" == 'y' ]; then
+  if [ "${force_flag}" == 'y' ]; then
     Reset_force_dbrootpwd
   else
     sleep 2 && [ ! -e /tmp/mysql.sock ] && service mysqld start
@@ -136,7 +136,7 @@ if [ "${quiet_yn}" == 'y' ]; then
   fi
 else
   Input_dbrootpwd
-  if [ "${force_yn}" == 'y' ]; then
+  if [ "${force_flag}" == 'y' ]; then
     Reset_force_dbrootpwd
   else
     Reset_Interaction_dbrootpwd

+ 10 - 10
ss.sh

@@ -57,13 +57,13 @@ while :; do
       Show_Help; exit 0
       ;;
     -q|--quiet)
-      quiet_yn=y; shift 1
+      quiet_flag=y; shift 1
       ;;
     -i|--install)
-      install_yn=y; shift 1
+      install_flag=y; shift 1
       ;;
     -u|--uninstall)
-      uninstall_yn=y; shift 1
+      uninstall_flag=y; shift 1
       ;;
     --libev)
       libev_queit=y; ss_option=1; shift 1
@@ -72,7 +72,7 @@ while :; do
       python_queit=y; ss_option=2; shift 1
       ;;
     --adduser)
-      adduser_yn=y; shift 1
+      adduser_flag=y; shift 1
       ;;
     --password)
       password_queit=y; SS_password=$2; shift 2
@@ -263,15 +263,15 @@ Install_SS_libev() {
 
 Uninstall_SS() {
   while :; do echo
-    [ "${quiet_yn}" != 'y' ] && read -e -p "Do you want to uninstall SS? [y/n]: " uninstall_yn
-    if [[ ! "${uninstall_yn}" =~ ^[y,n]$ ]]; then
+    [ "${quiet_flag}" != 'y' ] && read -e -p "Do you want to uninstall SS? [y/n]: " uninstall_flag
+    if [[ ! "${uninstall_flag}" =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
       break
     fi
   done
 
-  if [ "${uninstall_yn}" == 'y' ]; then
+  if [ "${uninstall_flag}" == 'y' ]; then
     [ -n "$(ps -ef | grep -v grep | grep -iE "ssserver|ss-server")" ] && service shadowsocks stop
     [ -e /lib/systemd/system/shadowsocks.service ] && { systemctl disable shadowsocks; rm -f /lib/systemd/system/shadowsocks.service; }
     [ "${PM}" == 'yum' ] && chkconfig --del shadowsocks
@@ -343,7 +343,7 @@ Your Encryption Method: ${CMSG}aes-256-cfb${CEND}
 "
 }
 
-if [ "${install_yn}" == 'y' -o "${ARG_NUM}" == '0' ]; then
+if [ "${install_flag}" == 'y' -o "${ARG_NUM}" == '0' ]; then
   Def_parameter
   [ "${ss_option}" == '1' ] && Install_SS_libev
   [ "${ss_option}" == '2' ] && Install_SS_python
@@ -352,7 +352,7 @@ if [ "${install_yn}" == 'y' -o "${ARG_NUM}" == '0' ]; then
   Print_User_SS
 fi
 
-if [ "${adduser_yn}" == 'y' ]; then
+if [ "${adduser_flag}" == 'y' ]; then
   Check_SS
   if [ "${ss_option}" == '2' ]; then
     AddUser_SS
@@ -369,7 +369,7 @@ if [ "${adduser_yn}" == 'y' ]; then
   fi
 fi
 
-if [ "${uninstall_yn}" == 'y' ]; then
+if [ "${uninstall_flag}" == 'y' ]; then
   Check_SS
   Uninstall_SS
 fi

+ 65 - 66
uninstall.sh

@@ -61,41 +61,41 @@ while :; do
       Show_Help; exit 0
       ;;
     -q|--quiet)
-      quiet_yn=y
-      uninstall_yn=y
+      quiet_flag=y
+      uninstall_flag=y
       shift 1
       ;;
     --all)
-      all_yn=y
-      web_yn=y
-      mysql_yn=y
-      postgresql_yn=y
-      mongodb_yn=y
-      php_yn=y
-      hhvm_yn=y
-      pureftpd_yn=y
-      redis_yn=y
-      memcached_yn=y
-      phpmyadmin_yn=y
+      all_flag=y
+      web_flag=y
+      mysql_flag=y
+      postgresql_flag=y
+      mongodb_flag=y
+      php_flag=y
+      hhvm_flag=y
+      pureftpd_flag=y
+      redis_flag=y
+      memcached_flag=y
+      phpmyadmin_flag=y
       shift 1
       ;;
     --web)
-      web_yn=y; shift 1
+      web_flag=y; shift 1
       ;;
     --mysql)
-      mysql_yn=y; shift 1
+      mysql_flag=y; shift 1
       ;;
     --postgresql)
-      postgresql_yn=y; shift 1
+      postgresql_flag=y; shift 1
       ;;
     --mongodb)
-      mongodb_yn=y; shift 1
+      mongodb_flag=y; shift 1
       ;;
     --php)
-      php_yn=y; shift 1
+      php_flag=y; shift 1
       ;;
     --phpcache)
-      phpcache_yn=y; shift 1
+      phpcache_flag=y; shift 1
       ;;
     --php_extensions)
       php_extensions=$2; shift 2
@@ -115,19 +115,19 @@ while :; do
       [ -n "`echo ${php_extensions} | grep -w xdebug`" ] && pecl_xdebug=1
       ;;
     --hhvm)
-      hhvm_yn=y; shift 1
+      hhvm_flag=y; shift 1
       ;;
     --pureftpd)
-      pureftpd_yn=y; shift 1
+      pureftpd_flag=y; shift 1
       ;;
     --redis)
-      redis_yn=y; shift 1
+      redis_flag=y; shift 1
       ;;
     --memcached)
-      memcached_yn=y; shift 1
+      memcached_flag=y; shift 1
       ;;
     --phpmyadmin)
-      phpmyadmin_yn=y; shift 1
+      phpmyadmin_flag=y; shift 1
       ;;
     --)
       shift
@@ -139,10 +139,10 @@ while :; do
 done
 
 Uninstall_status() {
-  if [ "${quiet_yn}" != 'y' ]; then
+  if [ "${quiet_flag}" != 'y' ]; then
     while :; do echo
-      read -e -p "Do you want to uninstall? [y/n]: " uninstall_yn
-      if [[ ! ${uninstall_yn} =~ ^[y,n]$ ]]; then
+      read -e -p "Do you want to uninstall? [y/n]: " uninstall_flag
+      if [[ ! ${uninstall_flag} =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
       else
         break
@@ -187,8 +187,7 @@ Uninstall_Web() {
   [ -d "/usr/java" ] && { rm -rf /usr/java; sed -i '/export JAVA_HOME=/d' /etc/profile; sed -i '/export CLASSPATH=/d' /etc/profile; sed -i 's@\$JAVA_HOME/bin:@@' /etc/profile; }
   [ -e "${wwwroot_dir}" ] && /bin/mv ${wwwroot_dir}{,$(date +%Y%m%d%H)}
   sed -i 's@^website_name=.*@website_name=@' ./options.conf
-  sed -i 's@^local_bankup_yn=.*@local_bankup_yn=y@' ./options.conf
-  sed -i 's@^remote_bankup_yn=.*@remote_bankup_yn=n@' ./options.conf
+  sed -i 's@^backup_content=.*@backup_content=@' ./options.conf
 }
 
 Print_MySQL() {
@@ -532,7 +531,7 @@ What Are You Doing?
       Print_openssl
       Print_phpMyAdmin
       Uninstall_status
-      if [ "${uninstall_yn}" == 'y' ]; then
+      if [ "${uninstall_flag}" == 'y' ]; then
         Uninstall_Web
         Uninstall_MySQL
         Uninstall_PostgreSQL
@@ -552,64 +551,64 @@ What Are You Doing?
       Print_Warn
       Print_web
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_Web || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_Web || exit
       ;;
     2)
       Print_Warn
       Print_MySQL
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_MySQL || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_MySQL || exit
       ;;
     3)
       Print_Warn
       Print_PostgreSQL
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_PostgreSQL || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_PostgreSQL || exit
       ;;
     4)
       Print_Warn
       Print_MongoDB
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_MongoDB || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_MongoDB || exit
       ;;
     5)
       Print_PHP
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_PHP || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_PHP || exit
       ;;
     6)
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_PHPcache || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_PHPcache || exit
       ;;
     7)
       Menu_PHPext
       [ "${phpext_option}" != '0' ] && Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_PHPext || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_PHPext || exit
       ;;
     8)
       Print_HHVM
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_HHVM || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_HHVM || exit
       ;;
     9)
       Print_PureFtpd
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_PureFtpd || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_PureFtpd || exit
       ;;
     10)
       Print_Redis_server
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_Redis_server || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_Redis_server || exit
       ;;
     11)
       Print_Memcached_server
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_Memcached_server || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_Memcached_server || exit
       ;;
     12)
       Print_phpMyAdmin
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_phpMyAdmin || exit
+      [ "${uninstall_flag}" == 'y' ] && Uninstall_phpMyAdmin || exit
       ;;
     q)
       exit
@@ -622,31 +621,31 @@ done
 if [ ${ARG_NUM} == 0 ]; then
   Menu
 else
-  [ "${web_yn}" == 'y' ] && Print_web
-  [ "${mysql_yn}" == 'y' ] && Print_MySQL
-  [ "${postgresql_yn}" == 'y' ] && Print_PostgreSQL
-  [ "${mongodb_yn}" == 'y' ] && Print_MongoDB
-  [ "${php_yn}" == 'y' ] && Print_PHP
-  [ "${hhvm_yn}" == 'y' ] && Print_HHVM
-  [ "${pureftpd_yn}" == 'y' ] && Print_PureFtpd
-  [ "${redis_yn}" == 'y' ] && Print_Redis_server
-  [ "${memcached_yn}" == 'y' ] && Print_Memcached_server
-  [ "${phpmyadmin_yn}" == 'y' ] && Print_phpMyAdmin
-  [ "${all_yn}" == 'y' ] && Print_openssl
+  [ "${web_flag}" == 'y' ] && Print_web
+  [ "${mysql_flag}" == 'y' ] && Print_MySQL
+  [ "${postgresql_flag}" == 'y' ] && Print_PostgreSQL
+  [ "${mongodb_flag}" == 'y' ] && Print_MongoDB
+  [ "${php_flag}" == 'y' ] && Print_PHP
+  [ "${hhvm_flag}" == 'y' ] && Print_HHVM
+  [ "${pureftpd_flag}" == 'y' ] && Print_PureFtpd
+  [ "${redis_flag}" == 'y' ] && Print_Redis_server
+  [ "${memcached_flag}" == 'y' ] && Print_Memcached_server
+  [ "${phpmyadmin_flag}" == 'y' ] && Print_phpMyAdmin
+  [ "${all_flag}" == 'y' ] && Print_openssl
   Uninstall_status
-  if [ "${uninstall_yn}" == 'y' ]; then
-    [ "${web_yn}" == 'y' ] && Uninstall_Web
-    [ "${mysql_yn}" == 'y' ] && Uninstall_MySQL
-    [ "${postgresql_yn}" == 'y' ] && Uninstall_PostgreSQL
-    [ "${mongodb_yn}" == 'y' ] && Uninstall_MongoDB
-    [ "${phpcache_yn}" == 'y' ] && Uninstall_PHPcache
+  if [ "${uninstall_flag}" == 'y' ]; then
+    [ "${web_flag}" == 'y' ] && Uninstall_Web
+    [ "${mysql_flag}" == 'y' ] && Uninstall_MySQL
+    [ "${postgresql_flag}" == 'y' ] && Uninstall_PostgreSQL
+    [ "${mongodb_flag}" == 'y' ] && Uninstall_MongoDB
+    [ "${phpcache_flag}" == 'y' ] && Uninstall_PHPcache
     Uninstall_PHPext
-    [ "${php_yn}" == 'y' ] && Uninstall_PHP
-    [ "${hhvm_yn}" == 'y' ] && Uninstall_HHVM
-    [ "${pureftpd_yn}" == 'y' ] && Uninstall_PureFtpd
-    [ "${redis_yn}" == 'y' ] && Uninstall_Redis_server
-    [ "${memcached_yn}" == 'y' ] && Uninstall_Memcached_server
-    [ "${phpmyadmin_yn}" == 'y' ] && Uninstall_phpMyAdmin
-    [ "${all_yn}" == 'y' ] && Uninstall_openssl
+    [ "${php_flag}" == 'y' ] && Uninstall_PHP
+    [ "${hhvm_flag}" == 'y' ] && Uninstall_HHVM
+    [ "${pureftpd_flag}" == 'y' ] && Uninstall_PureFtpd
+    [ "${redis_flag}" == 'y' ] && Uninstall_Redis_server
+    [ "${memcached_flag}" == 'y' ] && Uninstall_Memcached_server
+    [ "${phpmyadmin_flag}" == 'y' ] && Uninstall_phpMyAdmin
+    [ "${all_flag}" == 'y' ] && Uninstall_openssl
   fi
 fi

+ 25 - 25
vhost.sh

@@ -53,39 +53,39 @@ while :; do
       Show_Help; exit 0
       ;;
     -q|--quiet)
-      quiet_yn=y; shift 1
+      quiet_flag=y; shift 1
       ;;
     -l|--list)
-      list_yn=y; shift 1
+      list_flag=y; shift 1
       ;;
     --add)
-      add_yn=y; shift 1
+      add_flag=y; shift 1
       ;;
     --delete|--del)
-      delete_yn=y; shift 1
+      delete_flag=y; shift 1
       ;;
     --httponly)
-      sslquiet_yn=y
-      httponly_yn=y
+      sslquiet_flag=y
+      httponly_flag=y
       Domian_Mode=1
       shift 1
       ;;
     --selfsigned)
-      sslquiet_yn=y
-      selfsigned_yn=y
+      sslquiet_flag=y
+      selfsigned_flag=y
       Domian_Mode=2
       shift 1
       ;;
     --letsencrypt)
-      sslquiet_yn=y
-      letsencrypt_yn=y
+      sslquiet_flag=y
+      letsencrypt_flag=y
       Domian_Mode=3
       shift 1
       ;;
     --dnsapi)
-      sslquiet_yn=y
-      dnsapi_yn=y
-      letsencrypt_yn=y
+      sslquiet_flag=y
+      dnsapi_flag=y
+      letsencrypt_flag=y
       shift 1
       ;;
     --)
@@ -232,8 +232,8 @@ If you enter '.', the field will be left blank.
 
     openssl req -new -newkey rsa:2048 -sha256 -nodes -out ${PATH_SSL}/${domain}.csr -keyout ${PATH_SSL}/${domain}.key -subj "/C=${SELFSIGNEDSSL_C}/ST=${SELFSIGNEDSSL_ST}/L=${SELFSIGNEDSSL_L}/O=${SELFSIGNEDSSL_O}/OU=${SELFSIGNEDSSL_OU}/CN=${domain}" > /dev/null 2>&1
     openssl x509 -req -days 36500 -sha256 -in ${PATH_SSL}/${domain}.csr -signkey ${PATH_SSL}/${domain}.key -out ${PATH_SSL}/${domain}.crt > /dev/null 2>&1
-  elif [ "${Domian_Mode}" == '3' -o "${dnsapi_yn}" == 'y' ]; then
-    if [ "${moredomain}" == "*.${domain}" -o "${dnsapi_yn}" == 'y' ]; then
+  elif [ "${Domian_Mode}" == '3' -o "${dnsapi_flag}" == 'y' ]; then
+    if [ "${moredomain}" == "*.${domain}" -o "${dnsapi_flag}" == 'y' ]; then
       while :; do echo
         echo 'Please select DNS provider:'
         echo "${CMSG}dp${CEND},${CMSG}cx${CEND},${CMSG}ali${CEND},${CMSG}cf${CEND},${CMSG}aws${CEND},${CMSG}linode${CEND},${CMSG}he${CEND},${CMSG}namesilo${CEND},${CMSG}dgon${CEND},${CMSG}freedns${CEND},${CMSG}gd${CEND},${CMSG}namecom${CEND} and so on."
@@ -322,14 +322,14 @@ Print_SSL() {
     echo "$(printf "%-30s" "Self-signed SSL Certificate:")${CMSG}${PATH_SSL}/${domain}.crt${CEND}"
     echo "$(printf "%-30s" "SSL Private Key:")${CMSG}${PATH_SSL}/${domain}.key${CEND}"
     echo "$(printf "%-30s" "SSL CSR File:")${CMSG}${PATH_SSL}/${domain}.csr${CEND}"
-  elif [ "${Domian_Mode}" == '3' -o "${dnsapi_yn}" == 'y' ]; then
+  elif [ "${Domian_Mode}" == '3' -o "${dnsapi_flag}" == 'y' ]; then
     echo "$(printf "%-30s" "Let's Encrypt SSL Certificate:")${CMSG}${PATH_SSL}/${domain}.crt${CEND}"
     echo "$(printf "%-30s" "SSL Private Key:")${CMSG}${PATH_SSL}/${domain}.key${CEND}"
   fi
 }
 
 Input_Add_domain() {
-  if [ "${sslquiet_yn}" != 'y' ]; then
+  if [ "${sslquiet_flag}" != 'y' ]; then
     while :;do
       printf "
 What Are You Doing?
@@ -346,7 +346,7 @@ What Are You Doing?
       fi
     done
   fi
-  if [ "${Domian_Mode}" == '3' -o "${dnsapi_yn}" == 'y' ] && [ ! -e ~/.acme.sh/acme.sh ]; then
+  if [ "${Domian_Mode}" == '3' -o "${dnsapi_flag}" == 'y' ] && [ ! -e ~/.acme.sh/acme.sh ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     [ ! -e acme.sh-master.tar.gz ] && wget -qc http://mirrors.linuxeye.com/oneinstack/src/acme.sh-master.tar.gz
     tar xzf acme.sh-master.tar.gz
@@ -356,7 +356,7 @@ What Are You Doing?
     popd > /dev/null
   fi
   [ -e ~/.acme.sh/account.conf ] && sed -i '/^CERT_HOME=/d' ~/.acme.sh/account.conf
-  if [[ "${Domian_Mode}" =~ ^[2-3]$ ]] || [ "${dnsapi_yn}" == 'y' ]; then
+  if [[ "${Domian_Mode}" =~ ^[2-3]$ ]] || [ "${dnsapi_flag}" == 'y' ]; then
     if [ -e "${web_install_dir}/sbin/nginx" ]; then
       nginx_ssl_flag=y
       PATH_SSL=${web_install_dir}/conf/ssl
@@ -996,7 +996,7 @@ Del_NGX_Vhost() {
                 fi
               done
               if [ "${Del_Vhost_wwwroot_flag}" == 'y' ]; then
-		if [ "${quiet_yn}" != 'y' ]; then
+		if [ "${quiet_flag}" != 'y' ]; then
                   echo "Press Ctrl+c to cancel or Press any key to continue..."
                   char=$(get_char)
 		fi
@@ -1048,7 +1048,7 @@ Del_Apache_Vhost() {
               done
 
               if [ "${Del_Vhost_wwwroot_flag}" == 'y' ]; then
-		if [ "${quiet_yn}" != 'y' ]; then
+		if [ "${quiet_flag}" != 'y' ]; then
                   echo "Press Ctrl+c to cancel or Press any key to continue..."
                   char=$(get_char)
 		fi
@@ -1102,7 +1102,7 @@ Del_Tomcat_Vhost() {
               done
 
               if [ "${Del_Vhost_wwwroot_flag}" == 'y' ]; then
-		if [ "${quiet_yn}" != 'y' ]; then
+		if [ "${quiet_flag}" != 'y' ]; then
                   echo "Press Ctrl+c to cancel or Press any key to continue..."
                   char=$(get_char)
 		fi
@@ -1139,7 +1139,7 @@ List_Vhost() {
 if [ ${ARG_NUM} == 0 ]; then
   Add_Vhost
 else
-  [ "${add_yn}" == 'y' -o "${sslquiet_yn}" == 'y' ] && Add_Vhost
-  [ "${list_yn}" == 'y' ] && List_Vhost
-  [ "${delete_yn}" == 'y' ] && { Del_NGX_Vhost; Del_Apache_Vhost; Del_Tomcat_Vhost; }
+  [ "${add_flag}" == 'y' -o "${sslquiet_flag}" == 'y' ] && Add_Vhost
+  [ "${list_flag}" == 'y' ] && List_Vhost
+  [ "${delete_flag}" == 'y' ] && { Del_NGX_Vhost; Del_Apache_Vhost; Del_Tomcat_Vhost; }
 fi