Browse Source

remove unneeded spaces
convert indentation to spaces

kaneawk 8 years ago
parent
commit
554ca0dfea
77 changed files with 1009 additions and 1009 deletions
  1. 1 1
      backup.sh
  2. 9 9
      backup_setup.sh
  3. 3 3
      config/index.html
  4. 3 3
      config/index_cn.html
  5. 1 1
      config/nginx.conf
  6. 1 1
      config/nginx_apache.conf
  7. 1 1
      config/nginx_tomcat.conf
  8. 7 7
      config/pure-ftpd.conf
  9. 1 1
      config/server.xml
  10. 3 3
      include/GraphicsMagick.sh
  11. 20 20
      include/ZendGuardLoader.sh
  12. 6 6
      include/apache-2.2.sh
  13. 8 8
      include/apache-2.4.sh
  14. 4 4
      include/check_os.sh
  15. 1 1
      include/check_port.py
  16. 5 5
      include/color.sh
  17. 2 2
      include/eaccelerator-1.0-dev.sh
  18. 1 1
      include/get_ipaddr.py
  19. 6 6
      include/hhvm_CentOS.sh
  20. 21 21
      include/init_CentOS.sh
  21. 12 12
      include/init_Debian.sh
  22. 16 16
      include/init_Ubuntu.sh
  23. 5 5
      include/ioncube.sh
  24. 1 1
      include/jdk-1.7.sh
  25. 9 9
      include/mariadb-10.0.sh
  26. 9 9
      include/mariadb-10.1.sh
  27. 7 7
      include/mariadb-5.5.sh
  28. 11 11
      include/memcached.sh
  29. 5 5
      include/mysql-5.5.sh
  30. 6 6
      include/mysql-5.6.sh
  31. 8 8
      include/mysql-5.7.sh
  32. 4 4
      include/nginx.sh
  33. 4 4
      include/openresty.sh
  34. 7 7
      include/percona-5.5.sh
  35. 8 8
      include/percona-5.6.sh
  36. 8 8
      include/percona-5.7.sh
  37. 15 15
      include/php-5.3.sh
  38. 14 14
      include/php-5.4.sh
  39. 12 12
      include/php-5.5.sh
  40. 11 11
      include/php-5.6.sh
  41. 14 14
      include/php-7.sh
  42. 4 4
      include/pureftpd.sh
  43. 2 2
      include/redis.sh
  44. 1 1
      include/tcmalloc.sh
  45. 8 8
      include/tengine.sh
  46. 12 12
      include/tomcat-7.sh
  47. 12 12
      include/tomcat-8.sh
  48. 8 8
      include/upgrade_db.sh
  49. 1 1
      include/upgrade_phpmyadmin.sh
  50. 1 1
      include/upgrade_redis.sh
  51. 3 3
      include/upgrade_web.sh
  52. 3 3
      include/xcache.sh
  53. 2 2
      include/zendopcache.sh
  54. 1 1
      init.d/Memcached-init-CentOS
  55. 8 8
      init.d/Memcached-init-Ubuntu
  56. 20 20
      init.d/Nginx-init-CentOS
  57. 137 137
      init.d/Nginx-init-Ubuntu
  58. 3 3
      init.d/Redis-server-init-CentOS
  59. 34 34
      init.d/Redis-server-init-Ubuntu
  60. 8 8
      init.d/Shadowsocks-python-init
  61. 12 12
      init.d/Supervisor-init-CentOS
  62. 5 5
      init.d/Tomcat-init
  63. 32 32
      install.sh
  64. 3 3
      options.conf
  65. 16 16
      pureftpd_vhost.sh
  66. 2 2
      reset_db_root_password.sh
  67. 14 14
      shadowsocks.sh
  68. 2 2
      tools/ckssh.py
  69. 1 1
      tools/db_bk.sh
  70. 96 96
      tools/mabs.sh
  71. 111 111
      tools/mscp.exp
  72. 83 83
      tools/mssh.exp
  73. 24 24
      tools/thread.sh
  74. 1 1
      tools/website_bk.sh
  75. 21 21
      uninstall.sh
  76. 8 8
      upgrade.sh
  77. 20 20
      vhost.sh

+ 1 - 1
backup.sh

@@ -65,5 +65,5 @@ elif [ "$backup_destination" == 'local,remote' ];then
     [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Local_BK
     [ -n "`echo $backup_content | grep -ow db`" ] && DB_Remote_BK
     [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Remote_BK
-    ./mabs.sh -c config_bakcup.txt -T -1 | tee mabs.log	
+    ./mabs.sh -c config_bakcup.txt -T -1 | tee mabs.log
 fi

+ 9 - 9
backup_setup.sh

@@ -24,14 +24,14 @@ printf "
 # Check if user is root
 [ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
-while : 
+while :
 do
     echo
     echo 'Please select your backup destination:'
     echo -e "\t${CMSG}1${CEND}. Only Localhost"
     echo -e "\t${CMSG}2${CEND}. Only Remote host"
     echo -e "\t${CMSG}3${CEND}. Localhost and Remote host"
-    read -p "Please input a number:(Default 1 press Enter) " DESC_BK 
+    read -p "Please input a number:(Default 1 press Enter) " DESC_BK
     [ -z "$DESC_BK" ] && DESC_BK=1
     if [[ ! $DESC_BK =~ ^[1-3]$ ]];then
         echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
@@ -71,7 +71,7 @@ while :
 do
     echo
     echo "Please enter the directory for save the backup file: "
-    read -p "(Default directory: $backup_dir): " NEW_backup_dir 
+    read -p "(Default directory: $backup_dir): " NEW_backup_dir
     [ -z "$NEW_backup_dir" ] && NEW_backup_dir="$backup_dir"
     if [ -z "`echo $NEW_backup_dir| grep '^/'`" ]; then
         echo "${CWARNING}input error! ${CEND}"
@@ -85,7 +85,7 @@ while :
 do
     echo
     echo "Pleas enter a valid backup number of days: "
-    read -p "(Default days: 5): " expired_days 
+    read -p "(Default days: 5): " expired_days
     [ -z "$expired_days" ] && expired_days=5
     [ -n "`echo $expired_days | sed -n "/^[0-9]\+$/p"`" ] && break || echo "${CWARNING}input error! Please only enter numbers! ${CEND}"
 done
@@ -116,7 +116,7 @@ if [ "$CONTENT_BK" != '1' ];then
     do
         echo
         echo "Please enter one or more name for website, separate multiple website names with commas: "
-        read -p "(Default website: `echo $websites | tr ' ' ','`) " website_name 
+        read -p "(Default website: `echo $websites | tr ' ' ','`) " website_name
         website_name=`echo $website_name | tr -d ' '`
         [ -z "$website_name" ] && website_name="`echo $websites | tr ' ' ','`"
         W_tmp=0
@@ -134,7 +134,7 @@ echo "You have to backup the content:"
 [ "$CONTENT_BK" != '2' ] && echo "Database: ${CMSG}$db_name${CEND}"
 [ "$CONTENT_BK" != '1' ] && echo "Website: ${CMSG}$website_name${CEND}"
 
-if [[ "$DESC_BK" =~ ^[2,3]$ ]];then 
+if [[ "$DESC_BK" =~ ^[2,3]$ ]];then
     > tools/iplist.txt
     while :
     do
@@ -143,10 +143,10 @@ if [[ "$DESC_BK" =~ ^[2,3]$ ]];then
         [ -z "$remote_ip" -o "$remote_ip" == '127.0.0.1' ] && continue
         echo
         read -p "Please enter the remote host port(Default: 22) : " remote_port
-        [ -z "$remote_port" ] && remote_port=22 
+        [ -z "$remote_port" ] && remote_port=22
         echo
         read -p "Please enter the remote host user(Default: root) : " remote_user
-        [ -z "$remote_user" ] && remote_user=root 
+        [ -z "$remote_user" ] && remote_user=root
         echo
         read -p "Please enter the remote host password: " remote_password
         IPcode=$(echo "ibase=16;$(echo "$remote_ip" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
@@ -158,7 +158,7 @@ if [[ "$DESC_BK" =~ ^[2,3]$ ]];then
             [ -z "`grep $remote_ip tools/iplist.txt`" ] && echo "$remote_ip $remote_port $remote_user $remote_password" >> tools/iplist.txt || echo "${CWARNING}$remote_ip has been added! ${CEND}"
             while :
             do
-                read -p "Do you want to add more host ? [y/n]: " more_host_yn 
+                read -p "Do you want to add more host ? [y/n]: " more_host_yn
                 if [[ ! "$more_host_yn" =~ ^[y,n]$ ]];then
                     echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                 else

+ 3 - 3
config/index.html

@@ -12,9 +12,9 @@ font-family:"Microsoft YaHei",sans-serif;
 }
 .links {color: #009900}
 #main {
-	margin-right: auto;
-	margin-left: auto;
-	width: 920px;
+    margin-right: auto;
+    margin-left: auto;
+    width: 920px;
 }
 </style>
 </head>

+ 3 - 3
config/index_cn.html

@@ -12,9 +12,9 @@ font-family:微软雅黑,sans-serif;
 }
 .links {color: #009900}
 #main {
-	margin-right: auto;
-	margin-left: auto;
-	width: 920px;
+    margin-right: auto;
+    margin-left: auto;
+    width: 920px;
 }
 </style>
 </head>

+ 1 - 1
config/nginx.conf

@@ -23,7 +23,7 @@ http {
     keepalive_timeout 120;
     server_tokens off;
     tcp_nodelay on;
-    
+
     fastcgi_connect_timeout 300;
     fastcgi_send_timeout 300;
     fastcgi_read_timeout 300;

+ 1 - 1
config/nginx_apache.conf

@@ -23,7 +23,7 @@ http {
     keepalive_timeout 120;
     server_tokens off;
     tcp_nodelay on;
-    
+
     fastcgi_connect_timeout 300;
     fastcgi_send_timeout 300;
     fastcgi_read_timeout 300;

+ 1 - 1
config/nginx_tomcat.conf

@@ -23,7 +23,7 @@ http {
     keepalive_timeout 120;
     server_tokens off;
     tcp_nodelay on;
-    
+
     fastcgi_connect_timeout 300;
     fastcgi_send_timeout 300;
     fastcgi_read_timeout 300;

+ 7 - 7
config/pure-ftpd.conf

@@ -5,7 +5,7 @@
 #                                                          #
 ############################################################
 
-# If you want to run Pure-FTPd with this configuration   
+# If you want to run Pure-FTPd with this configuration
 # instead of command-line options, please run the
 # following command :
 #
@@ -91,7 +91,7 @@ SyslogFacility              ftp
 
 
 
-# Don't resolve host names in log files. Logs are less verbose, but 
+# Don't resolve host names in log files. Logs are less verbose, but
 # it uses less bandwidth. Set this to "yes" on very busy servers or
 # if you don't have a working DNS.
 
@@ -151,7 +151,7 @@ UnixAuthentication            yes
 # user wasn't found, another try # will be done with /etc/passwd and
 # /etc/shadow. If the SQL authentication fails because the password was wrong,
 # the authentication chain stops here. Authentication methods are chained in
-# the order they are given. 
+# the order they are given.
 
 
 
@@ -361,8 +361,8 @@ CreateHomeDir               no
 
 
 
-# This option is useful with servers where anonymous upload is 
-# allowed. As /var/ftp is in /var, it save some space and protect 
+# This option is useful with servers where anonymous upload is
+# allowed. As /var/ftp is in /var, it save some space and protect
 # the log files. When the partition is more that X percent full,
 # new uploads are disallowed.
 
@@ -440,7 +440,7 @@ CustomerProof              yes
 # for remote clients if they don't use UTF-8.
 # Works only if pure-ftpd has been compiled with --with-rfc2640
 
-# FileSystemCharset	big5
-# ClientCharset		big5
+# FileSystemCharset big5
+# ClientCharset     big5
 AllowOverwrite on
 AllowStoreRestart on

+ 1 - 1
config/server.xml

@@ -28,7 +28,7 @@
               acceptCount="1000"
               debug="0"
               disableUploadTimeout="true"
-	      useBodyEncodingForURI="true"
+        useBodyEncodingForURI="true"
               enableLookups="false"
               URIEncoding="UTF-8" />
     <Engine name="Catalina" defaultHost="localhost">

+ 3 - 3
include/GraphicsMagick.sh

@@ -12,7 +12,7 @@ Install_GraphicsMagick() {
 cd $oneinstack_dir/src
 src_url=http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/$GraphicsMagick_version/GraphicsMagick-$GraphicsMagick_version.tar.gz && Download_src
 
-tar xzf GraphicsMagick-$GraphicsMagick_version.tar.gz 
+tar xzf GraphicsMagick-$GraphicsMagick_version.tar.gz
 cd GraphicsMagick-$GraphicsMagick_version
 ./configure --prefix=/usr/local/graphicsmagick --enable-shared --enable-static
 make && make install
@@ -26,11 +26,11 @@ cd $oneinstack_dir/src
 if [ -e "$php_install_dir/bin/phpize" ];then
     if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
         src_url=https://pecl.php.net/get/gmagick-2.0.2RC2.tgz && Download_src
-        tar xzf gmagick-2.0.2RC2.tgz 
+        tar xzf gmagick-2.0.2RC2.tgz
         cd gmagick-2.0.2RC2
     else
         src_url=http://pecl.php.net/get/gmagick-$gmagick_version.tgz && Download_src
-        tar xzf gmagick-$gmagick_version.tgz 
+        tar xzf gmagick-$gmagick_version.tgz
         cd gmagick-$gmagick_version
     fi
     make clean

+ 20 - 20
include/ZendGuardLoader.sh

@@ -15,62 +15,62 @@ cd $oneinstack_dir/src
 PHP_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
 PHP_main_version=${PHP_version%.*}
 
-[ ! -d "`$php_install_dir/bin/php-config --extension-dir`" ] && mkdir -p `$php_install_dir/bin/php-config --extension-dir` 
+[ ! -d "`$php_install_dir/bin/php-config --extension-dir`" ] && mkdir -p `$php_install_dir/bin/php-config --extension-dir`
 if [ "$OS_BIT" == '64' ] ;then
     if [ "$PHP_main_version" == '5.6' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/zend-loader-php5.6-linux-x86_64.tar.gz && Download_src
-        tar xzf zend-loader-php5.6-linux-x86_64.tar.gz 
-        /bin/cp zend-loader-php5.6-linux-x86_64/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
-        rm -rf zend-loader-php5.6-linux-x86_64 
+        tar xzf zend-loader-php5.6-linux-x86_64.tar.gz
+        /bin/cp zend-loader-php5.6-linux-x86_64/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
+        rm -rf zend-loader-php5.6-linux-x86_64
     fi
 
     if [ "$PHP_main_version" == '5.5' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/zend-loader-php5.5-linux-x86_64.tar.gz && Download_src
-        tar xzf zend-loader-php5.5-linux-x86_64.tar.gz 
-        /bin/cp zend-loader-php5.5-linux-x86_64/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
-        rm -rf zend-loader-php5.5-linux-x86_64 
+        tar xzf zend-loader-php5.5-linux-x86_64.tar.gz
+        /bin/cp zend-loader-php5.5-linux-x86_64/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
+        rm -rf zend-loader-php5.5-linux-x86_64
     fi
 
     if [ "$PHP_main_version" == '5.4' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz && Download_src
         tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
-        /bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
+        /bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
         rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
     fi
 
     if [ "$PHP_main_version" == '5.3' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz && Download_src
         tar xzf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
-        /bin/cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
+        /bin/cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
         rm -rf ZendGuardLoader-php-5.3-linux-glibc23-x86_64
     fi
 else
     if [ "$PHP_main_version" == '5.6' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/zend-loader-php5.6-linux-i386.tar.gz && Download_src
-        tar xzf zend-loader-php5.6-linux-i386.tar.gz 
-        /bin/cp zend-loader-php5.6-linux-i386/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
-        rm -rf zend-loader-php5.6-linux-i386 
+        tar xzf zend-loader-php5.6-linux-i386.tar.gz
+        /bin/cp zend-loader-php5.6-linux-i386/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
+        rm -rf zend-loader-php5.6-linux-i386
     fi
 
     if [ "$PHP_main_version" == '5.5' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/zend-loader-php5.5-linux-i386.tar.gz && Download_src
         tar xzf zend-loader-php5.5-linux-i386.tar.gz
-        /bin/cp zend-loader-php5.5-linux-i386/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
+        /bin/cp zend-loader-php5.5-linux-i386/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
         rm -rf zend-loader-php5.5-linux-x386
     fi
 
     if [ "$PHP_main_version" == '5.4' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz && Download_src
-    	tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz
-    	/bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386/php-5.4.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
-    	rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386
+        tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz
+        /bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386/php-5.4.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
+        rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386
     fi
 
     if [ "$PHP_main_version" == '5.3' ];then
         src_url=http://mirrors.linuxeye.com/oneinstack/src/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz && Download_src
-    	tar xzf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
-    	/bin/cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir` 
-    	rm -rf ZendGuardLoader-php-5.3-linux-glibc23-i386
+        tar xzf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
+        /bin/cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
+        rm -rf ZendGuardLoader-php-5.3-linux-glibc23-i386
     fi
 fi
 
@@ -85,7 +85,7 @@ EOF
     echo "${CSUCCESS}ZendGuardLoader module install successfully! ${CEND}"
     [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
 else
-    echo "${CFAILURE}ZendGuardLoader module install failed, Please contact the author! ${CEND}" 
+    echo "${CFAILURE}ZendGuardLoader module install failed, Please contact the author! ${CEND}"
 fi
 cd ..
 }

+ 6 - 6
include/apache-2.2.sh

@@ -10,10 +10,10 @@
 
 Install_Apache-2-2() {
 cd $oneinstack_dir/src
-src_url=http://mirrors.linuxeye.com/apache/httpd/httpd-$apache_2_version.tar.gz && Download_src 
+src_url=http://mirrors.linuxeye.com/apache/httpd/httpd-$apache_2_version.tar.gz && Download_src
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf httpd-$apache_2_version.tar.gz
 cd httpd-$apache_2_version
@@ -31,7 +31,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$apache_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$apache_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $apache_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$apache_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -48,7 +48,7 @@ if [ "$Nginx_version" == '4' -a ! -e "$web_install_dir/sbin/nginx" ];then
     sed -i 's/^#ServerName www.example.com:80/ServerName 0.0.0.0:80/' $apache_install_dir/conf/httpd.conf
     TMP_PORT=80
     TMP_IP=$IPADDR
-elif [[ $Nginx_version =~ ^[1-3]$ ]] || [ -e "$web_install_dir/sbin/nginx" ];then 
+elif [[ $Nginx_version =~ ^[1-3]$ ]] || [ -e "$web_install_dir/sbin/nginx" ];then
     sed -i 's/^#ServerName www.example.com:80/ServerName 127.0.0.1:88/' $apache_install_dir/conf/httpd.conf
     sed -i 's@^Listen.*@Listen 127.0.0.1:88@' $apache_install_dir/conf/httpd.conf
     TMP_PORT=88
@@ -85,7 +85,7 @@ NameVirtualHost *:$TMP_PORT
 <VirtualHost *:$TMP_PORT>
     ServerAdmin admin@linuxeye.com
     DocumentRoot "$wwwroot_dir/default"
-    ServerName $TMP_IP 
+    ServerName $TMP_IP
     ErrorLog "$wwwlogs_dir/error_apache.log"
     CustomLog "$wwwlogs_dir/access_apache.log" common
 <Directory "$wwwroot_dir/default">
@@ -100,7 +100,7 @@ NameVirtualHost *:$TMP_PORT
     SetHandler server-status
     Order Deny,Allow
     Deny from all
-    Allow from 127.0.0.1 
+    Allow from 127.0.0.1
 </Location>
 </VirtualHost>
 EOF

+ 8 - 8
include/apache-2.4.sh

@@ -11,9 +11,9 @@
 Install_Apache-2-4() {
 cd $oneinstack_dir/src
 src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz && Download_src
-src_url=http://archive.apache.org/dist/apr/apr-$apr_version.tar.gz && Download_src 
-src_url=http://archive.apache.org/dist/apr/apr-util-$apr_util_version.tar.gz && Download_src 
-src_url=http://mirrors.linuxeye.com/apache/httpd/httpd-$apache_4_version.tar.gz && Download_src 
+src_url=http://archive.apache.org/dist/apr/apr-$apr_version.tar.gz && Download_src
+src_url=http://archive.apache.org/dist/apr/apr-util-$apr_util_version.tar.gz && Download_src
+src_url=http://mirrors.linuxeye.com/apache/httpd/httpd-$apache_4_version.tar.gz && Download_src
 
 tar xzf pcre-$pcre_version.tar.gz
 cd pcre-$pcre_version
@@ -22,7 +22,7 @@ make && make install
 cd ..
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf httpd-$apache_4_version.tar.gz
 tar xzf apr-$apr_version.tar.gz
@@ -44,7 +44,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$apache_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$apache_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $apache_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$apache_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -61,7 +61,7 @@ if [ "$Nginx_version" == '4' -a ! -e "$web_install_dir/sbin/nginx" ];then
     sed -i 's/^#ServerName www.example.com:80/ServerName 0.0.0.0:80/' $apache_install_dir/conf/httpd.conf
     TMP_PORT=80
     TMP_IP=$IPADDR
-elif [[ $Nginx_version =~ ^[1-3]$ ]] || [ -e "$web_install_dir/sbin/nginx" ];then 
+elif [[ $Nginx_version =~ ^[1-3]$ ]] || [ -e "$web_install_dir/sbin/nginx" ];then
     sed -i 's/^#ServerName www.example.com:80/ServerName 127.0.0.1:88/' $apache_install_dir/conf/httpd.conf
     sed -i 's@^Listen.*@Listen 127.0.0.1:88@' $apache_install_dir/conf/httpd.conf
     TMP_PORT=88
@@ -97,7 +97,7 @@ cat >> $apache_install_dir/conf/vhost/0.conf << EOF
 <VirtualHost *:$TMP_PORT>
     ServerAdmin admin@linuxeye.com
     DocumentRoot "$wwwroot_dir/default"
-    ServerName $TMP_IP 
+    ServerName $TMP_IP
     ErrorLog "$wwwlogs_dir/error_apache.log"
     CustomLog "$wwwlogs_dir/access_apache.log" common
 <Directory "$wwwroot_dir/default">
@@ -113,7 +113,7 @@ cat >> $apache_install_dir/conf/vhost/0.conf << EOF
     SetHandler server-status
     Order Deny,Allow
     Deny from all
-    Allow from 127.0.0.1 
+    Allow from 127.0.0.1
 </Location>
 </VirtualHost>
 EOF

+ 4 - 4
include/check_os.sh

@@ -15,15 +15,15 @@ if [ -n "`grep 'Aliyun Linux release' /etc/issue`" -o -e /etc/redhat-release ];t
     [ -n "`grep ' 5\.' /etc/redhat-release`" -o -n "`grep 'Aliyun Linux release5' /etc/issue`" ] && CentOS_RHEL_version=5
 elif [ -n "`grep bian /etc/issue`" -o "`lsb_release -is 2>/dev/null`" == 'Debian' ];then
     OS=Debian
-    [ ! -e "`which lsb_release`" ] && { apt-get -y update; apt-get -y install lsb-release; } 
+    [ ! -e "`which lsb_release`" ] && { apt-get -y update; apt-get -y install lsb-release; }
     Debian_version=`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`" ] && { apt-get -y update; apt-get -y install lsb-release; } 
-    Debian_version=`lsb_release -sr | awk -F. '{print $1}'`    
+    [ ! -e "`which lsb_release`" ] && { apt-get -y update; apt-get -y install lsb-release; }
+    Debian_version=`lsb_release -sr | awk -F. '{print $1}'`
 elif [ -n "`grep Ubuntu /etc/issue`" -o "`lsb_release -is 2>/dev/null`" == 'Ubuntu' ];then
     OS=Ubuntu
-    [ ! -e "`which lsb_release`" ] && { apt-get -y update; apt-get -y install lsb-release; } 
+    [ ! -e "`which lsb_release`" ] && { apt-get -y update; apt-get -y install lsb-release; }
     Ubuntu_version=`lsb_release -sr | awk -F. '{print $1}'`
 else
     echo "${CFAILURE}Does not support this OS, Please contact the author! ${CEND}"

+ 1 - 1
include/check_port.py

@@ -5,7 +5,7 @@ def IsOpen(ip,port):
     try:
         s.connect((ip,int(port)))
         s.shutdown(2)
-        print True 
+        print True
     except:
         print False
 if __name__ == '__main__':

+ 5 - 5
include/color.sh

@@ -10,11 +10,11 @@
 
 echo=echo
 for cmd in echo /bin/echo; do
-	$cmd >/dev/null 2>&1 || continue
-	if ! $cmd -e "" | grep -qE '^-e'; then
-		echo=$cmd
-		break
-	fi
+    $cmd >/dev/null 2>&1 || continue
+    if ! $cmd -e "" | grep -qE '^-e'; then
+        echo=$cmd
+        break
+    fi
 done
 CSI=$($echo -e "\033[")
 CEND="${CSI}0m"

+ 2 - 2
include/eaccelerator-1.0-dev.sh

@@ -13,8 +13,8 @@ cd $oneinstack_dir/src
 src_url=https://github.com/eaccelerator/eaccelerator/tarball/master && Download_src
 
 /bin/mv master eaccelerator-eaccelerator-42067ac.tar.gz
-tar xzf eaccelerator-eaccelerator-42067ac.tar.gz 
-cd eaccelerator-eaccelerator-42067ac 
+tar xzf eaccelerator-eaccelerator-42067ac.tar.gz
+cd eaccelerator-eaccelerator-42067ac
 make clean
 $php_install_dir/bin/phpize
 ./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config

+ 1 - 1
include/get_ipaddr.py

@@ -18,5 +18,5 @@ def Get_local_ip():
         return "127.0.0.1"
 
 if __name__ == "__main__":
-    IPADDR = Get_local_ip() 
+    IPADDR = Get_local_ip()
     print IPADDR

+ 6 - 6
include/hhvm_CentOS.sh

@@ -12,7 +12,7 @@ Install_hhvm_CentOS() {
 cd $oneinstack_dir/src
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 if [ "$CentOS_RHEL_version" == '7' ];then
     if [ -e /etc/yum.repos.d/epel.repo_bk ];then
@@ -43,7 +43,7 @@ if [ "$CentOS_RHEL_version" == '6' ];then
     if [ -e /etc/yum.repos.d/epel.repo_bk ];then
         /bin/mv /etc/yum.repos.d/epel.repo{_bk,}
     elif [ ! -e /etc/yum.repos.d/epel.repo ];then
-        cat > /etc/yum.repos.d/epel.repo << EOF 
+        cat > /etc/yum.repos.d/epel.repo << EOF
 [epel]
 name=Extra Packages for Enterprise Linux 6 - \$basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch
@@ -69,7 +69,7 @@ enabled=1
 gpgcheck=0
 EOF
     yum --disablerepo=epel -y install mysql mysql-devel mysql-libs
-    yum --disablerepo=epel -y install hhvm 
+    yum --disablerepo=epel -y install hhvm
 fi
 
 userdel -r nginx;userdel -r saslauth
@@ -137,9 +137,9 @@ post_max_size = 50000000
 EOF
 
 if [ -e "$web_install_dir/sbin/nginx" -a -e "/usr/bin/hhvm" -a ! -e "$php_install_dir" ];then
-    sed -i 's@/dev/shm/php-cgi.sock@/var/log/hhvm/sock@' $web_install_dir/conf/nginx.conf 
-    [ -z "`grep 'fastcgi_param SCRIPT_FILENAME' $web_install_dir/conf/nginx.conf`" ] && sed -i "s@fastcgi_index index.php;@&\n\t\tfastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;@" $web_install_dir/conf/nginx.conf 
-    sed -i 's@include fastcgi.conf;@include fastcgi_params;@' $web_install_dir/conf/nginx.conf 
+    sed -i 's@/dev/shm/php-cgi.sock@/var/log/hhvm/sock@' $web_install_dir/conf/nginx.conf
+    [ -z "`grep 'fastcgi_param SCRIPT_FILENAME' $web_install_dir/conf/nginx.conf`" ] && sed -i "s@fastcgi_index index.php;@&\n\t\tfastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;@" $web_install_dir/conf/nginx.conf
+    sed -i 's@include fastcgi.conf;@include fastcgi_params;@' $web_install_dir/conf/nginx.conf
     service nginx reload
 fi
 

+ 21 - 21
include/init_CentOS.sh

@@ -14,11 +14,11 @@ yum clean all
 yum makecache
 
 if [ "$CentOS_RHEL_version" == '7' ];then
-    yum -y install iptables-services 
+    yum -y install iptables-services
     systemctl mask firewalld.service
     systemctl enable iptables.service
 elif [ "$CentOS_RHEL_version" == '6' ];then
-    yum -y groupremove "FTP Server" "PostgreSQL Database client" "PostgreSQL Database server" "MySQL Database server" "MySQL Database client" "Web Server" "Office Suite and Productivity" "E-mail server" "Ruby Support" "Printing client" 
+    yum -y groupremove "FTP Server" "PostgreSQL Database client" "PostgreSQL Database server" "MySQL Database server" "MySQL Database client" "Web Server" "Office Suite and Productivity" "E-mail server" "Ruby Support" "Printing client"
 elif [ "$CentOS_RHEL_version" == '5' ];then
     yum -y groupremove "FTP Server" "Windows File Server" "PostgreSQL Database" "News Server" "MySQL Database" "DNS Name Server" "Web Server" "Dialup Networking Support" "Mail Server" "Ruby" "Office/Productivity" "Sound and Video" "Printing Support" "OpenFabrics Enterprise Distribution"
 fi
@@ -58,9 +58,9 @@ sed -i 's/^id:.*$/id:3:initdefault:/' /etc/inittab
 init q
 
 # PS1
-[ -z "`cat ~/.bashrc | grep ^PS1`" ] && echo 'PS1="\[\e[37;40m\][\[\e[32;40m\]\u\[\e[37;40m\]@\h \[\e[35;40m\]\W\[\e[0m\]]\\$ "' >> ~/.bashrc 
+[ -z "`cat ~/.bashrc | grep ^PS1`" ] && echo 'PS1="\[\e[37;40m\][\[\e[32;40m\]\u\[\e[37;40m\]@\h \[\e[35;40m\]\W\[\e[0m\]]\\$ "' >> ~/.bashrc
 
-# history size 
+# history size
 sed -i 's/^HISTSIZE=.*$/HISTSIZE=100/' /etc/profile
 [ -z "`cat ~/.bashrc | grep history-timestamp`" ] && echo "export PROMPT_COMMAND='{ msg=\$(history 1 | { read x y; echo \$y; });user=\$(whoami); echo \$(date \"+%Y-%m-%d %H:%M:%S\"):\$user:\`pwd\`/:\$msg ---- \$(who am i); } >> /tmp/\`hostname\`.\`whoami\`.history-timestamp'" >> ~/.bashrc
 
@@ -85,8 +85,8 @@ ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
 
 # Set DNS
 #cat > /etc/resolv.conf << EOF
-#nameserver 114.114.114.114 
-#nameserver 8.8.8.8 
+#nameserver 114.114.114.114
+#nameserver 8.8.8.8
 #EOF
 
 # alias vi
@@ -96,17 +96,17 @@ ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
 sed -i 's/net.ipv4.tcp_syncookies.*$/net.ipv4.tcp_syncookies = 1/g' /etc/sysctl.conf
 [ -z "`cat /etc/sysctl.conf | grep 'fs.file-max'`" ] && cat >> /etc/sysctl.conf << EOF
 fs.file-max=65535
-fs.inotify.max_user_instances = 8192 
-net.ipv4.tcp_fin_timeout = 30 
+fs.inotify.max_user_instances = 8192
+net.ipv4.tcp_fin_timeout = 30
 net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_tw_recycle = 1
 net.ipv4.ip_local_port_range = 1024 65000
-net.ipv4.tcp_max_syn_backlog = 65536 
+net.ipv4.tcp_max_syn_backlog = 65536
 net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
-net.core.somaxconn = 65535 
+net.core.somaxconn = 65535
 net.core.netdev_max_backlog = 262144
 net.ipv4.tcp_timestamps = 0
 net.ipv4.tcp_max_orphans = 262144
@@ -118,24 +118,24 @@ if [ "$CentOS_RHEL_version" == '5' ];then
     sed -i 's@^ca::ctrlaltdel@#&@' /etc/inittab
     sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/sysconfig/i18n
 elif [ "$CentOS_RHEL_version" == '6' ];then
-    sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES=/dev/tty[1-2]@' /etc/sysconfig/init	
+    sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES=/dev/tty[1-2]@' /etc/sysconfig/init
     sed -i 's@^start@#start@' /etc/init/control-alt-delete.conf
     sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/sysconfig/i18n
     [ -z "`grep net.netfilter.nf_conntrack_max /etc/sysctl.conf`" ] && cat >> /etc/sysctl.conf << EOF
-net.netfilter.nf_conntrack_max = 1048576 
+net.netfilter.nf_conntrack_max = 1048576
 net.netfilter.nf_conntrack_tcp_timeout_established = 1200
 EOF
 elif [ "$CentOS_RHEL_version" == '7' ];then
-    sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/locale.conf 
+    sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/locale.conf
     [ -z "`grep net.netfilter.nf_conntrack_max /etc/sysctl.conf`" ] && cat >> /etc/sysctl.conf << EOF
-net.netfilter.nf_conntrack_max = 1048576 
+net.netfilter.nf_conntrack_max = 1048576
 net.netfilter.nf_conntrack_tcp_timeout_established = 1200
 EOF
 fi
 init q
 
 # Update time
-ntpdate pool.ntp.org 
+ntpdate pool.ntp.org
 [ -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; }
 service crond restart
 
@@ -144,10 +144,10 @@ if [ -e '/etc/sysconfig/iptables' ] && [ -n "`grep ':INPUT DROP' /etc/sysconfig/
     IPTABLES_STATUS=yes
 else
     IPTABLES_STATUS=no
-fi 
+fi
 
 if [ "$IPTABLES_STATUS" == 'no' ];then
-    [ -e '/etc/sysconfig/iptables' ] && /bin/mv /etc/sysconfig/iptables{,_bk} 
+    [ -e '/etc/sysconfig/iptables' ] && /bin/mv /etc/sysconfig/iptables{,_bk}
     cat > /etc/sysconfig/iptables << EOF
 # Firewall configuration written by system-config-securitylevel
 # Manual customization of this file is not recommended.
@@ -172,15 +172,15 @@ EOF
 fi
 
 FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/sysconfig/iptables`
-[ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/sysconfig/iptables 
+[ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/sysconfig/iptables
 service iptables restart
 service sshd restart
 
 # install tmux
 if [ ! -e "`which tmux`" ];then
     cd src
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/libevent-2.0.22-stable.tar.gz && Download_src 
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/tmux-2.2.tar.gz && Download_src 
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/libevent-2.0.22-stable.tar.gz && Download_src
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/tmux-2.2.tar.gz && Download_src
     tar xzf libevent-2.0.22-stable.tar.gz
     cd libevent-2.0.22-stable
     ./configure
@@ -203,7 +203,7 @@ fi
 # install htop
 if [ ! -e "`which htop`" ];then
     cd src
-    src_url=http://hisham.hm/htop/releases/2.0.0/htop-2.0.0.tar.gz && Download_src 
+    src_url=http://hisham.hm/htop/releases/2.0.0/htop-2.0.0.tar.gz && Download_src
     tar xzf htop-2.0.0.tar.gz
     cd htop-2.0.0
     ./configure

+ 12 - 12
include/init_Debian.sh

@@ -17,7 +17,7 @@ dpkg -l | grep ^rc | awk '{print $2}' | xargs dpkg -P
 apt-get -y update
 
 # check upgrade OS
-[ "$upgrade_yn" == 'y' ] && apt-get -y upgrade 
+[ "$upgrade_yn" == 'y' ] && apt-get -y upgrade
 
 # Install needed packages
 for Package in gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libjpeg-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev libreadline-dev curl libcurl3 libcurl4-openssl-dev libcurl4-gnutls-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev bison re2c libsasl2-dev libxslt1-dev libicu-dev locales libcloog-ppl0 patch vim zip unzip tmux htop wget bc expect rsync git lsof lrzsz cron logrotate ntpdate
@@ -26,10 +26,10 @@ do
 done
 
 # PS1
-[ -z "`cat ~/.bashrc | grep ^PS1`" ] && echo "PS1='\${debian_chroot:+(\$debian_chroot)}\\[\\e[1;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '" >> ~/.bashrc 
+[ -z "`cat ~/.bashrc | grep ^PS1`" ] && echo "PS1='\${debian_chroot:+(\$debian_chroot)}\\[\\e[1;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '" >> ~/.bashrc
 
-# history size 
-[ -z "`cat ~/.bashrc | grep ^HISTSIZE`" ] && echo 'HISTSIZE=100' >> ~/.bashrc 
+# history size
+[ -z "`cat ~/.bashrc | grep ^HISTSIZE`" ] && echo 'HISTSIZE=100' >> ~/.bashrc
 [ -z "`cat ~/.bashrc | grep history-timestamp`" ] && echo "export PROMPT_COMMAND='{ msg=\$(history 1 | { read x y; echo \$y; });user=\$(whoami); echo \$(date \"+%Y-%m-%d %H:%M:%S\"):\$user:\`pwd\`/:\$msg ---- \$(who am i); } >> /tmp/\`hostname\`.\`whoami\`.history-timestamp'" >> ~/.bashrc
 
 # /etc/security/limits.conf
@@ -66,30 +66,30 @@ sed -i 's@^# alias@alias@g' ~/.bashrc
 # /etc/sysctl.conf
 [ -z "`cat /etc/sysctl.conf | grep 'fs.file-max'`" ] && cat >> /etc/sysctl.conf << EOF
 fs.file-max=65535
-fs.inotify.max_user_instances = 8192 
+fs.inotify.max_user_instances = 8192
 net.ipv4.tcp_syncookies = 1
 net.ipv4.tcp_fin_timeout = 30
 net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_tw_recycle = 1
 net.ipv4.ip_local_port_range = 1024 65000
-net.ipv4.tcp_max_syn_backlog = 65536 
+net.ipv4.tcp_max_syn_backlog = 65536
 net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
-net.core.somaxconn = 65535 
+net.core.somaxconn = 65535
 net.core.netdev_max_backlog = 262144
 net.ipv4.tcp_timestamps = 0
 net.ipv4.tcp_max_orphans = 262144
 EOF
 sysctl -p
 
-sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES="/dev/tty[1-2]"@' /etc/default/console-setup 
+sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES="/dev/tty[1-2]"@' /etc/default/console-setup
 sed -i 's@^# en_US.UTF-8@en_US.UTF-8@' /etc/locale.gen
 init q
 
 # Update time
-ntpdate pool.ntp.org 
+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; }
 service cron restart
 
@@ -101,7 +101,7 @@ else
 fi
 
 if [ "$IPTABLES_STATUS" == 'no' ];then
-    [ -e '/etc/iptables.up.rules' ] && /bin/mv /etc/iptables.up.rules{,_bk} 
+    [ -e '/etc/iptables.up.rules' ] && /bin/mv /etc/iptables.up.rules{,_bk}
     cat > /etc/iptables.up.rules << EOF
 # Firewall configuration written by system-config-securitylevel
 # Manual customization of this file is not recommended.
@@ -125,8 +125,8 @@ COMMIT
 EOF
 fi
 
-FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/iptables.up.rules` 
-[ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/iptables.up.rules 
+FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/iptables.up.rules`
+[ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/iptables.up.rules
 iptables-restore < /etc/iptables.up.rules
 cat > /etc/network/if-pre-up.d/iptables << EOF
 #!/bin/bash

+ 16 - 16
include/init_Ubuntu.sh

@@ -17,7 +17,7 @@ dpkg -l | grep ^rc | awk '{print $2}' | xargs dpkg -P
 apt-get -y update
 
 # check upgrade OS
-[ "$upgrade_yn" == 'y' ] && apt-get -y upgrade 
+[ "$upgrade_yn" == 'y' ] && apt-get -y upgrade
 
 # Install needed packages
 for Package in gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev libreadline-dev curl libcurl3 libcurl4-openssl-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev re2c libsasl2-dev libxslt1-dev libicu-dev patch vim zip unzip tmux htop wget bc expect rsync git lsof lrzsz ntpdate
@@ -25,11 +25,11 @@ do
     apt-get -y install $Package
 done
 
-if [[ "$Ubuntu_version" =~ ^14$|^15$ ]];then 
+if [[ "$Ubuntu_version" =~ ^14$|^15$ ]];then
     apt-get -y install libcloog-ppl1
     apt-get -y remove bison
     cd src
-    src_url=http://ftp.gnu.org/gnu/bison/bison-2.7.1.tar.gz && Download_src 
+    src_url=http://ftp.gnu.org/gnu/bison/bison-2.7.1.tar.gz && Download_src
     tar xzf bison-2.7.1.tar.gz
     cd bison-2.7.1
     ./configure
@@ -48,10 +48,10 @@ fi
 #[ "$sendmail_yn" == 'y' ] && apt-get -y install sendmail
 
 # PS1
-[ -z "`cat ~/.bashrc | grep ^PS1`" ] && echo "PS1='\${debian_chroot:+(\$debian_chroot)}\\[\\e[1;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '" >> ~/.bashrc 
+[ -z "`cat ~/.bashrc | grep ^PS1`" ] && echo "PS1='\${debian_chroot:+(\$debian_chroot)}\\[\\e[1;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '" >> ~/.bashrc
 
-# history size 
-sed -i 's/HISTSIZE=.*$/HISTSIZE=100/g' ~/.bashrc 
+# history size
+sed -i 's/HISTSIZE=.*$/HISTSIZE=100/g' ~/.bashrc
 [ -z "`cat ~/.bashrc | grep history-timestamp`" ] && echo "export PROMPT_COMMAND='{ msg=\$(history 1 | { read x y; echo \$y; });user=\$(whoami); echo \$(date \"+%Y-%m-%d %H:%M:%S\"):\$user:\`pwd\`/:\$msg ---- \$(who am i); } >> /tmp/\`hostname\`.\`whoami\`.history-timestamp'" >> ~/.bashrc
 
 # /etc/security/limits.conf
@@ -85,31 +85,31 @@ ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
 # /etc/sysctl.conf
 [ -z "`cat /etc/sysctl.conf | grep 'fs.file-max'`" ] && cat >> /etc/sysctl.conf << EOF
 fs.file-max=65535
-fs.inotify.max_user_instances = 8192 
+fs.inotify.max_user_instances = 8192
 net.ipv4.tcp_syncookies = 1
-net.ipv4.tcp_fin_timeout = 30 
+net.ipv4.tcp_fin_timeout = 30
 net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_tw_recycle = 1
 net.ipv4.ip_local_port_range = 1024 65000
-net.ipv4.tcp_max_syn_backlog = 65536 
+net.ipv4.tcp_max_syn_backlog = 65536
 net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
-net.core.somaxconn = 65535 
+net.core.somaxconn = 65535
 net.core.netdev_max_backlog = 262144
 net.ipv4.tcp_timestamps = 0
 net.ipv4.tcp_max_orphans = 262144
 EOF
 sysctl -p
 
-sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES="/dev/tty[1-2]"@' /etc/default/console-setup 
+sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES="/dev/tty[1-2]"@' /etc/default/console-setup
 sed -i 's@^@#@g' /etc/init/tty[3-6].conf
 echo 'en_US.UTF-8 UTF-8' > /var/lib/locales/supported.d/local
-sed -i 's@^@#@g' /etc/init/control-alt-delete.conf 
+sed -i 's@^@#@g' /etc/init/control-alt-delete.conf
 
 # Update time
-ntpdate pool.ntp.org 
+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; }
 service cron restart
 
@@ -121,7 +121,7 @@ else
 fi
 
 if [ "$IPTABLES_STATUS" == 'no' ];then
-    [ -e '/etc/iptables.up.rules' ] && /bin/mv /etc/iptables.up.rules{,_bk} 
+    [ -e '/etc/iptables.up.rules' ] && /bin/mv /etc/iptables.up.rules{,_bk}
     cat > /etc/iptables.up.rules << EOF
 # Firewall configuration written by system-config-securitylevel
 # Manual customization of this file is not recommended.
@@ -145,8 +145,8 @@ COMMIT
 EOF
 fi
 
-FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/iptables.up.rules` 
-[ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/iptables.up.rules 
+FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/iptables.up.rules`
+[ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/iptables.up.rules
 iptables-restore < /etc/iptables.up.rules
 cat > /etc/network/if-pre-up.d/iptables << EOF
 #!/bin/bash

+ 5 - 5
include/ioncube.sh

@@ -22,18 +22,18 @@ else
     tar xzf ioncube_loaders_lin_x86.tar.gz
 fi
 
-[ ! -d "`$php_install_dir/bin/php-config --extension-dir`" ] && mkdir -p `$php_install_dir/bin/php-config --extension-dir` 
+[ ! -d "`$php_install_dir/bin/php-config --extension-dir`" ] && mkdir -p `$php_install_dir/bin/php-config --extension-dir`
 if [ "$PHP_main_version" == '5.6' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.6.so `$php_install_dir/bin/php-config --extension-dir` 
+    /bin/cp ioncube/ioncube_loader_lin_5.6.so `$php_install_dir/bin/php-config --extension-dir`
     zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.6.so"
 elif [ "$PHP_main_version" == '5.5' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.5.so `$php_install_dir/bin/php-config --extension-dir` 
+    /bin/cp ioncube/ioncube_loader_lin_5.5.so `$php_install_dir/bin/php-config --extension-dir`
     zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.5.so"
 elif [ "$PHP_main_version" == '5.4' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.4.so `$php_install_dir/bin/php-config --extension-dir` 
+    /bin/cp ioncube/ioncube_loader_lin_5.4.so `$php_install_dir/bin/php-config --extension-dir`
     zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.4.so"
 elif [ "$PHP_main_version" == '5.3' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.3.so `$php_install_dir/bin/php-config --extension-dir` 
+    /bin/cp ioncube/ioncube_loader_lin_5.3.so `$php_install_dir/bin/php-config --extension-dir`
     zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.3.so"
 else
     exit 1

+ 1 - 1
include/jdk-1.7.sh

@@ -19,7 +19,7 @@ src_url=http://mirrors.linuxeye.com/jdk/$JDK_FILE && Download_src
 
 [ "$OS" == 'CentOS' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
 
-tar xzf $JDK_FILE 
+tar xzf $JDK_FILE
 
 if [ -d "$JDK_NAME" ];then
     rm -rf $JAVA_dir; mkdir -p $JAVA_dir

+ 9 - 9
include/mariadb-10.0.sh

@@ -15,7 +15,7 @@ cd $oneinstack_dir/src
 
 LIBC_VERSION=`getconf -a | grep GNU_LIBC_VERSION | awk '{print $NF}'`
 LIBC_YN=`echo "$LIBC_VERSION < 2.14" | bc`
-[ $LIBC_YN == '1' ] && GLIBC_FLAG=linux || GLIBC_FLAG=linux-glibc_214 
+[ $LIBC_YN == '1' ] && GLIBC_FLAG=linux || GLIBC_FLAG=linux-glibc_214
 
 src_url=$DOWN_ADDR/mariadb-${mariadb_10_0_version}/bintar-${GLIBC_FLAG}-$SYS_BIT_a/mariadb-${mariadb_10_0_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz && Download_src
 
@@ -23,9 +23,9 @@ id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
 mkdir -p $mariadb_data_dir;chown mysql.mysql -R $mariadb_data_dir
-tar zxf mariadb-${mariadb_10_0_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz 
+tar zxf mariadb-${mariadb_10_0_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz
 [ ! -d "$mariadb_install_dir" ] && mkdir -p $mariadb_install_dir
-mv mariadb-${mariadb_10_0_version}-*-${SYS_BIT_b}/* $mariadb_install_dir 
+mv mariadb-${mariadb_10_0_version}-*-${SYS_BIT_b}/* $mariadb_install_dir
 if [ "$je_tc_malloc" == '1' ];then
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' $mariadb_install_dir/bin/mysqld_safe
 elif [ "$je_tc_malloc" == '2' ];then
@@ -36,7 +36,7 @@ if [ -d "$mariadb_install_dir/support-files" ];then
     echo "${CSUCCESS}MariaDB install successfully! ${CEND}"
 else
     rm -rf $mariadb_install_dir
-    echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}" 
+    echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}"
     kill -9 $$
 fi
 
@@ -77,7 +77,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -99,7 +99,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $mariadb_data_dir/mysql-error.log
 slow_query_log = 1
@@ -146,7 +146,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -178,7 +178,7 @@ $mariadb_install_dir/scripts/mysql_install_db --user=mysql --basedir=$mariadb_in
 chown mysql.mysql -R $mariadb_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mariadb_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mariadb_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $mariadb_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$mariadb_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -190,7 +190,7 @@ $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "delete from mysql.proxies
 $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "drop database test;"
 $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "reset master;"
 rm -rf /etc/ld.so.conf.d/{mysql,mariadb,percona}*.conf
-echo "$mariadb_install_dir/lib" > /etc/ld.so.conf.d/mariadb.conf 
+echo "$mariadb_install_dir/lib" > /etc/ld.so.conf.d/mariadb.conf
 ldconfig
 service mysqld stop
 }

+ 9 - 9
include/mariadb-10.1.sh

@@ -15,7 +15,7 @@ cd $oneinstack_dir/src
 
 LIBC_VERSION=`getconf -a | grep GNU_LIBC_VERSION | awk '{print $NF}'`
 LIBC_YN=`echo "$LIBC_VERSION < 2.14" | bc`
-[ $LIBC_YN == '1' ] && GLIBC_FLAG=linux || GLIBC_FLAG=linux-glibc_214 
+[ $LIBC_YN == '1' ] && GLIBC_FLAG=linux || GLIBC_FLAG=linux-glibc_214
 
 src_url=$DOWN_ADDR/mariadb-${mariadb_10_1_version}/bintar-${GLIBC_FLAG}-$SYS_BIT_a/mariadb-${mariadb_10_1_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz && Download_src
 
@@ -23,9 +23,9 @@ id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
 mkdir -p $mariadb_data_dir;chown mysql.mysql -R $mariadb_data_dir
-tar zxf mariadb-${mariadb_10_1_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz 
+tar zxf mariadb-${mariadb_10_1_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz
 [ ! -d "$mariadb_install_dir" ] && mkdir -p $mariadb_install_dir
-mv mariadb-${mariadb_10_1_version}-*-${SYS_BIT_b}/* $mariadb_install_dir 
+mv mariadb-${mariadb_10_1_version}-*-${SYS_BIT_b}/* $mariadb_install_dir
 if [ "$je_tc_malloc" == '1' ];then
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' $mariadb_install_dir/bin/mysqld_safe
 elif [ "$je_tc_malloc" == '2' ];then
@@ -36,7 +36,7 @@ if [ -d "$mariadb_install_dir/support-files" ];then
     echo "${CSUCCESS}MariaDB install successfully! ${CEND}"
 else
     rm -rf $mariadb_install_dir
-    echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}" 
+    echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}"
     kill -9 $$
 fi
 
@@ -77,7 +77,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -99,7 +99,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $mariadb_data_dir/mysql-error.log
 slow_query_log = 1
@@ -146,7 +146,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -178,7 +178,7 @@ $mariadb_install_dir/scripts/mysql_install_db --user=mysql --basedir=$mariadb_in
 chown mysql.mysql -R $mariadb_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mariadb_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mariadb_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $mariadb_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$mariadb_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -190,7 +190,7 @@ $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "delete from mysql.proxies
 $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "drop database test;"
 $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "reset master;"
 rm -rf /etc/ld.so.conf.d/{mysql,mariadb,percona}*.conf
-echo "$mariadb_install_dir/lib" > /etc/ld.so.conf.d/mariadb.conf 
+echo "$mariadb_install_dir/lib" > /etc/ld.so.conf.d/mariadb.conf
 ldconfig
 service mysqld stop
 }

+ 7 - 7
include/mariadb-5.5.sh

@@ -15,7 +15,7 @@ cd $oneinstack_dir/src
 
 LIBC_VERSION=`getconf -a | grep GNU_LIBC_VERSION | awk '{print $NF}'`
 LIBC_YN=`echo "$LIBC_VERSION < 2.14" | bc`
-[ $LIBC_YN == '1' ] && GLIBC_FLAG=linux || GLIBC_FLAG=linux-glibc_214 
+[ $LIBC_YN == '1' ] && GLIBC_FLAG=linux || GLIBC_FLAG=linux-glibc_214
 
 src_url=$DOWN_ADDR/mariadb-${mariadb_5_5_version}/bintar-${GLIBC_FLAG}-$SYS_BIT_a/mariadb-${mariadb_5_5_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz && Download_src
 
@@ -23,9 +23,9 @@ id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
 mkdir -p $mariadb_data_dir;chown mysql.mysql -R $mariadb_data_dir
-tar zxf mariadb-${mariadb_5_5_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz 
+tar zxf mariadb-${mariadb_5_5_version}-${GLIBC_FLAG}-${SYS_BIT_b}.tar.gz
 [ ! -d "$mariadb_install_dir" ] && mkdir -p $mariadb_install_dir
-mv mariadb-${mariadb_5_5_version}-*-${SYS_BIT_b}/* $mariadb_install_dir 
+mv mariadb-${mariadb_5_5_version}-*-${SYS_BIT_b}/* $mariadb_install_dir
 if [ "$je_tc_malloc" == '1' ];then
      sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' $mariadb_install_dir/bin/mysqld_safe
 elif [ "$je_tc_malloc" == '2' ];then
@@ -77,7 +77,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -147,7 +147,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -179,7 +179,7 @@ $mariadb_install_dir/scripts/mysql_install_db --user=mysql --basedir=$mariadb_in
 chown mysql.mysql -R $mariadb_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mariadb_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mariadb_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $mariadb_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$mariadb_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -191,7 +191,7 @@ $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "delete from mysql.proxies
 $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "drop database test;"
 $mariadb_install_dir/bin/mysql -uroot -p$dbrootpwd -e "reset master;"
 rm -rf /etc/ld.so.conf.d/{mysql,mariadb,percona}*.conf
-echo "$mariadb_install_dir/lib" > /etc/ld.so.conf.d/mariadb.conf 
+echo "$mariadb_install_dir/lib" > /etc/ld.so.conf.d/mariadb.conf
 ldconfig
 service mysqld stop
 }

+ 11 - 11
include/memcached.sh

@@ -26,10 +26,10 @@ if [ -d "$memcached_install_dir/include/memcached" ];then
     cd ..
     rm -rf memcached-$memcached_version
     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; } 
+    [ "$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; }
     sed -i "s@/usr/local/memcached@$memcached_install_dir@g" /etc/init.d/memcached
-    [ -n "`grep 'CACHESIZE=' /etc/init.d/memcached`" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=`expr $Mem / 8`@" /etc/init.d/memcached 
+    [ -n "`grep 'CACHESIZE=' /etc/init.d/memcached`" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=`expr $Mem / 8`@" /etc/init.d/memcached
     [ -n "`grep 'start_instance default 256;' /etc/init.d/memcached`" ] && sed -i "s@start_instance default 256;@start_instance default `expr $Mem / 8`;@" /etc/init.d/memcached
     service memcached start
 else
@@ -52,8 +52,8 @@ if [ -e "$php_install_dir/bin/phpize" ];then
         cd pecl-memcache-php7
     else
         src_url=http://pecl.php.net/get/memcache-$memcache_pecl_version.tgz && Download_src
-        tar xzf memcache-$memcache_pecl_version.tgz 
-        cd memcache-$memcache_pecl_version 
+        tar xzf memcache-$memcache_pecl_version.tgz
+        cd memcache-$memcache_pecl_version
     fi
     make clean
     $php_install_dir/bin/phpize
@@ -68,7 +68,7 @@ EOF
         cd ..
         rm -rf memcache-$memcache_pecl_version
     else
-        echo "${CFAILURE}PHP memcache module install failed, Please contact the author! ${CEND}" 
+        echo "${CFAILURE}PHP memcache module install failed, Please contact the author! ${CEND}"
     fi
 fi
 cd ..
@@ -81,16 +81,16 @@ if [ -e "$php_install_dir/bin/phpize" ];then
     # php memcached extension
     tar xzf libmemcached-$libmemcached_version.tar.gz
     cd libmemcached-$libmemcached_version
-    [ "$OS" == 'CentOS' ] && yum -y install cyrus-sasl-devel 
-    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && sed -i "s@lthread -pthread -pthreads@lthread -lpthread -pthreads@" ./configure 
+    [ "$OS" == 'CentOS' ] && yum -y install cyrus-sasl-devel
+    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && sed -i "s@lthread -pthread -pthreads@lthread -lpthread -pthreads@" ./configure
     ./configure --with-memcached=$memcached_install_dir
     make && make install
     cd ..
     rm -rf libmemcached-$libmemcached_version
 
     if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
-        #git clone -b php7 https://github.com/php-memcached-dev/php-memcached.git 
-        #cd php-memcached 
+        #git clone -b php7 https://github.com/php-memcached-dev/php-memcached.git
+        #cd php-memcached
         src_url=http://mirrors.linuxeye.com/oneinstack/src/php-memcached-php7.tgz && Download_src
         tar xzf php-memcached-php7.tgz
         cd php-memcached-php7
@@ -113,7 +113,7 @@ EOF
         rm -rf memcached-$memcached_pecl_version
         [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
     else
-        echo "${CFAILURE}PHP memcached module install failed, Please contact the author! ${CEND}" 
+        echo "${CFAILURE}PHP memcached module install failed, Please contact the author! ${CEND}"
     fi
 fi
 cd ..

+ 5 - 5
include/mysql-5.5.sh

@@ -84,7 +84,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -106,7 +106,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $mysql_data_dir/mysql-error.log
 slow_query_log = 1
@@ -153,7 +153,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -185,7 +185,7 @@ $mysql_install_dir/scripts/mysql_install_db --user=mysql --basedir=$mysql_instal
 chown mysql.mysql -R $mysql_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mysql_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mysql_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $mysql_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$mysql_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -198,7 +198,7 @@ $mysql_install_dir/bin/mysql -uroot -p$dbrootpwd -e "drop database test;"
 $mysql_install_dir/bin/mysql -uroot -p$dbrootpwd -e "reset master;"
 rm -rf /etc/ld.so.conf.d/{mysql,mariadb,percona}*.conf
 [ -e "$mysql_install_dir/my.cnf" ] && rm -rf $mysql_install_dir/my.cnf
-echo "$mysql_install_dir/lib" > /etc/ld.so.conf.d/mysql.conf 
+echo "$mysql_install_dir/lib" > /etc/ld.so.conf.d/mysql.conf
 ldconfig
 service mysqld stop
 }

+ 6 - 6
include/mysql-5.6.sh

@@ -67,7 +67,7 @@ no-auto-rehash
 port = 3306
 socket = /tmp/mysql.sock
 
-basedir = $mysql_install_dir 
+basedir = $mysql_install_dir
 datadir = $mysql_data_dir
 pid-file = $mysql_data_dir/mysql.pid
 user = mysql
@@ -84,7 +84,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -106,7 +106,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $mysql_data_dir/mysql-error.log
 slow_query_log = 1
@@ -154,7 +154,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -186,7 +186,7 @@ $mysql_install_dir/scripts/mysql_install_db --user=mysql --basedir=$mysql_instal
 chown mysql.mysql -R $mysql_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mysql_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mysql_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $mysql_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$mysql_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -198,7 +198,7 @@ $mysql_install_dir/bin/mysql -uroot -p$dbrootpwd -e "delete from mysql.proxies_p
 $mysql_install_dir/bin/mysql -uroot -p$dbrootpwd -e "drop database test;"
 $mysql_install_dir/bin/mysql -uroot -p$dbrootpwd -e "reset master;"
 rm -rf /etc/ld.so.conf.d/{mysql,mariadb,percona}*.conf
-echo "$mysql_install_dir/lib" > /etc/ld.so.conf.d/mysql.conf 
+echo "$mysql_install_dir/lib" > /etc/ld.so.conf.d/mysql.conf
 [ -e "$mysql_install_dir/my.cnf" ] && rm -rf $mysql_install_dir/my.cnf
 ldconfig
 service mysqld stop

+ 8 - 8
include/mysql-5.7.sh

@@ -22,10 +22,10 @@ src_url=$DOWN_ADDR_MYSQL/mysql-${mysql_5_7_version}-linux-glibc2.5-${SYS_BIT_b}.
 id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
-[ ! -d "$mysql_install_dir" ] && mkdir -p $mysql_install_dir 
+[ ! -d "$mysql_install_dir" ] && mkdir -p $mysql_install_dir
 mkdir -p $mysql_data_dir;chown mysql.mysql -R $mysql_data_dir
 
-tar zxf mysql-${mysql_5_7_version}-linux-glibc2.5-${SYS_BIT_b}.tar.gz 
+tar zxf mysql-${mysql_5_7_version}-linux-glibc2.5-${SYS_BIT_b}.tar.gz
 mv mysql-${mysql_5_7_version}-linux-glibc2.5-${SYS_BIT_b}/* $mysql_install_dir
 if [ "$je_tc_malloc" == '1' ];then
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' $mysql_install_dir/bin/mysqld_safe
@@ -67,7 +67,7 @@ no-auto-rehash
 port = 3306
 socket = /tmp/mysql.sock
 
-basedir = $mysql_install_dir 
+basedir = $mysql_install_dir
 datadir = $mysql_data_dir
 pid-file = $mysql_data_dir/mysql.pid
 user = mysql
@@ -84,7 +84,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -106,7 +106,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $mysql_data_dir/mysql-error.log
 slow_query_log = 1
@@ -155,7 +155,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -187,7 +187,7 @@ $mysql_install_dir/bin/mysqld --initialize-insecure --user=mysql --basedir=$mysq
 chown mysql.mysql -R $mysql_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mysql_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$mysql_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $mysql_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$mysql_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -196,7 +196,7 @@ $mysql_install_dir/bin/mysql -e "grant all privileges on *.* to root@'localhost'
 $mysql_install_dir/bin/mysql -uroot -p$dbrootpwd -e "reset master;"
 rm -rf /etc/ld.so.conf.d/{mysql,mariadb,percona}*.conf
 [ -e "$mysql_install_dir/my.cnf" ] && rm -rf $mysql_install_dir/my.cnf
-echo "$mysql_install_dir/lib" > /etc/ld.so.conf.d/mysql.conf 
+echo "$mysql_install_dir/lib" > /etc/ld.so.conf.d/mysql.conf
 ldconfig
 service mysqld stop
 }

+ 4 - 4
include/nginx.sh

@@ -14,7 +14,7 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz &&
 src_url=http://nginx.org/download/nginx-$nginx_version.tar.gz && Download_src
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf pcre-$pcre_version.tar.gz
 tar xzf nginx-$nginx_version.tar.gz
@@ -44,11 +44,11 @@ if [ -e "$nginx_install_dir/conf/nginx.conf" ];then
     echo "${CSUCCESS}Nginx install successfully! ${CEND}"
 else
     rm -rf $nginx_install_dir
-    echo "${CFAILURE}Nginx install failed, Please Contact the author! ${CEND}" 
+    echo "${CFAILURE}Nginx install failed, Please Contact the author! ${CEND}"
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$nginx_install_dir/sbin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$nginx_install_dir/sbin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $nginx_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$nginx_install_dir/sbin:\1@" /etc/profile
 . /etc/profile
 
@@ -86,7 +86,7 @@ EOF
 sed -i "s@/data/wwwroot/default@$wwwroot_dir/default@" $nginx_install_dir/conf/nginx.conf
 sed -i "s@/data/wwwlogs@$wwwlogs_dir@g" $nginx_install_dir/conf/nginx.conf
 sed -i "s@^user www www@user $run_user $run_user@" $nginx_install_dir/conf/nginx.conf
-[ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $nginx_install_dir/conf/nginx.conf 
+[ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $nginx_install_dir/conf/nginx.conf
 
 # logrotate nginx log
 cat > /etc/logrotate.d/nginx << EOF

+ 4 - 4
include/openresty.sh

@@ -14,7 +14,7 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz &&
 src_url=https://openresty.org/download/openresty-$openresty_version.tar.gz && Download_src
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf pcre-$pcre_version.tar.gz
 tar xzf openresty-$openresty_version.tar.gz
@@ -41,11 +41,11 @@ if [ -e "$openresty_install_dir/nginx/conf/nginx.conf" ];then
     echo "${CSUCCESS}OpenResty install successfully! ${CEND}"
 else
     rm -rf $openresty_install_dir
-    echo "${CFAILURE}OpenResty install failed, Please Contact the author! ${CEND}" 
+    echo "${CFAILURE}OpenResty install failed, Please Contact the author! ${CEND}"
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$openresty_install_dir/nginx/sbin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$openresty_install_dir/nginx/sbin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $openresty_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$openresty_install_dir/nginx/sbin:\1@" /etc/profile
 . /etc/profile
 
@@ -83,7 +83,7 @@ EOF
 sed -i "s@/data/wwwroot/default@$wwwroot_dir/default@" $openresty_install_dir/nginx/conf/nginx.conf
 sed -i "s@/data/wwwlogs@$wwwlogs_dir@g" $openresty_install_dir/nginx/conf/nginx.conf
 sed -i "s@^user www www@user $run_user $run_user@" $openresty_install_dir/nginx/conf/nginx.conf
-[ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $openresty_install_dir/nginx/conf/nginx.conf 
+[ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $openresty_install_dir/nginx/conf/nginx.conf
 
 # logrotate nginx log
 cat > /etc/logrotate.d/nginx << EOF

+ 7 - 7
include/percona-5.5.sh

@@ -16,8 +16,8 @@ id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
 mkdir -p $percona_data_dir;chown mysql.mysql -R $percona_data_dir
-tar zxf percona-server-$percona_5_5_version.tar.gz 
-cd percona-server-$percona_5_5_version 
+tar zxf percona-server-$percona_5_5_version.tar.gz
+cd percona-server-$percona_5_5_version
 if [ "$je_tc_malloc" == '1' ];then
     EXE_LINKER="-DCMAKE_EXE_LINKER_FLAGS='-ljemalloc'"
 elif [ "$je_tc_malloc" == '2' ];then
@@ -40,7 +40,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=$percona_install_dir \
 -DDEFAULT_CHARSET=utf8mb4 \
 -DDEFAULT_COLLATION=utf8mb4_general_ci \
 $EXE_LINKER
-make -j `grep processor /proc/cpuinfo | wc -l` 
+make -j `grep processor /proc/cpuinfo | wc -l`
 make install
 
 if [ -d "$percona_install_dir/support-files" ];then
@@ -92,7 +92,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -114,7 +114,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $percona_data_dir/mysql-error.log
 slow_query_log = 1
@@ -161,7 +161,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -193,7 +193,7 @@ $percona_install_dir/scripts/mysql_install_db --user=mysql --basedir=$percona_in
 chown mysql.mysql -R $percona_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$percona_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$percona_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $percona_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$percona_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 

+ 8 - 8
include/percona-5.6.sh

@@ -16,8 +16,8 @@ id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
 mkdir -p $percona_data_dir;chown mysql.mysql -R $percona_data_dir
-tar zxf percona-server-$percona_5_6_version.tar.gz 
-cd percona-server-$percona_5_6_version 
+tar zxf percona-server-$percona_5_6_version.tar.gz
+cd percona-server-$percona_5_6_version
 if [ "$je_tc_malloc" == '1' ];then
     EXE_LINKER="-DCMAKE_EXE_LINKER_FLAGS='-ljemalloc'"
 elif [ "$je_tc_malloc" == '2' ];then
@@ -39,13 +39,13 @@ cmake . -DCMAKE_INSTALL_PREFIX=$percona_install_dir \
 -DDEFAULT_CHARSET=utf8mb4 \
 -DDEFAULT_COLLATION=utf8mb4_general_ci \
 $EXE_LINKER
-make -j `grep processor /proc/cpuinfo | wc -l` 
+make -j `grep processor /proc/cpuinfo | wc -l`
 make install
 
 if [ -d "$percona_install_dir/support-files" ];then
     echo "${CSUCCESS}Percona install successfully! ${CEND}"
     cd ..
-    rm -rf percona-server-$percona_5_6_version 
+    rm -rf percona-server-$percona_5_6_version
 else
     rm -rf $percona_install_dir
     echo "${CFAILURE}Percona install failed, Please contact the author! ${CEND}"
@@ -91,7 +91,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -113,7 +113,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $percona_data_dir/mysql-error.log
 slow_query_log = 1
@@ -161,7 +161,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -193,7 +193,7 @@ $percona_install_dir/scripts/mysql_install_db --user=mysql --basedir=$percona_in
 chown mysql.mysql -R $percona_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$percona_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$percona_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $percona_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$percona_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 

+ 8 - 8
include/percona-5.7.sh

@@ -30,8 +30,8 @@ id -u mysql >/dev/null 2>&1
 [ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
 
 mkdir -p $percona_data_dir;chown mysql.mysql -R $percona_data_dir
-tar zxf percona-server-$percona_5_7_version.tar.gz 
-cd percona-server-$percona_5_7_version 
+tar zxf percona-server-$percona_5_7_version.tar.gz
+cd percona-server-$percona_5_7_version
 if [ "$je_tc_malloc" == '1' ];then
     EXE_LINKER="-DCMAKE_EXE_LINKER_FLAGS='-ljemalloc'"
 elif [ "$je_tc_malloc" == '2' ];then
@@ -54,13 +54,13 @@ cmake . -DCMAKE_INSTALL_PREFIX=$percona_install_dir \
 -DDEFAULT_CHARSET=utf8mb4 \
 -DDEFAULT_COLLATION=utf8mb4_general_ci \
 $EXE_LINKER
-make -j `grep processor /proc/cpuinfo | wc -l` 
+make -j `grep processor /proc/cpuinfo | wc -l`
 make install
 
 if [ -d "$percona_install_dir/support-files" ];then
     echo "${CSUCCESS}Percona install successfully! ${CEND}"
     cd ..
-    rm -rf percona-server-$percona_5_7_version 
+    rm -rf percona-server-$percona_5_7_version
 else
     rm -rf $percona_install_dir
     echo "${CFAILURE}Percona install failed, Please contact the author! ${CEND}"
@@ -106,7 +106,7 @@ back_log = 300
 max_connections = 1000
 max_connect_errors = 6000
 open_files_limit = 65535
-table_open_cache = 128 
+table_open_cache = 128
 max_allowed_packet = 500M
 binlog_cache_size = 1M
 max_heap_table_size = 8M
@@ -128,7 +128,7 @@ ft_min_word_len = 4
 
 log_bin = mysql-bin
 binlog_format = mixed
-expire_logs_days = 7 
+expire_logs_days = 7
 
 log_error = $percona_data_dir/mysql-error.log
 slow_query_log = 1
@@ -176,7 +176,7 @@ read_buffer = 4M
 write_buffer = 4M
 EOF
 
-sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf 
+sed -i "s@max_connections.*@max_connections = $(($Mem/2))@" /etc/my.cnf
 if [ $Mem -gt 1500 -a $Mem -le 2500 ];then
     sed -i 's@^thread_cache_size.*@thread_cache_size = 16@' /etc/my.cnf
     sed -i 's@^query_cache_size.*@query_cache_size = 16M@' /etc/my.cnf
@@ -208,7 +208,7 @@ $percona_install_dir/bin/mysqld --initialize-insecure --user=mysql --basedir=$pe
 chown mysql.mysql -R $percona_data_dir
 [ -d '/etc/mysql' ] && mv /etc/mysql{,_bk}
 service mysqld start
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$percona_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$percona_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $percona_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$percona_install_dir/bin:\1@" /etc/profile
 
 . /etc/profile

+ 15 - 15
include/php-5.3.sh

@@ -44,7 +44,7 @@ cd mhash-$mhash_version
 ./configure
 make && make install
 cd ..
-rm -rf mhash-$mhash_version 
+rm -rf mhash-$mhash_version
 
 echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
 ldconfig
@@ -58,14 +58,14 @@ ldconfig
 ./configure
 make && make install
 cd ..
-rm -rf mcrypt-$mcrypt_version 
+rm -rf mcrypt-$mcrypt_version
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 # Problem building php-5.3 with openssl
 if [ "$Debian_version" == '8' -o "$Ubuntu_version" == '16' ];then
-    if [ -e '/usr/local/openssl/lib/libcrypto.a' ];then 
+    if [ -e '/usr/local/openssl/lib/libcrypto.a' ];then
         OpenSSL_args='--with-openssl=/usr/local/openssl'
     else
         src_url=http://mirrors.linuxeye.com/oneinstack/src/openssl-1.0.0s.tar.gz && Download_src
@@ -81,7 +81,7 @@ if [ "$Debian_version" == '8' -o "$Ubuntu_version" == '16' ];then
             Curl_args='--with-curl=/usr/local/curl'
         else
             src_url=http://mirrors.linuxeye.com/oneinstack/src/curl-7.29.0.tar.gz && Download_src
-            tar xzf curl-7.29.0.tar.gz 
+            tar xzf curl-7.29.0.tar.gz
             cd curl-7.29.0
             LDFLAGS="-Wl,-rpath=/usr/local/openssl/lib" ./configure --prefix=/usr/local/curl --with-ssl=/usr/local/openssl
             make && make install
@@ -97,7 +97,7 @@ fi
 tar xzf php-$php_3_version.tar.gz
 patch -d php-$php_3_version -p0 < fpm-race-condition.patch
 cd php-$php_3_version
-patch -p1 < ../php5.3patch 
+patch -p1 < ../php5.3patch
 patch -p1 < ../debian_patches_disable_SSLv2_for_openssl_1_0_0.patch
 make clean
 [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
@@ -136,7 +136,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $php_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$php_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -178,10 +178,10 @@ if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ]
 [global]
 pid = run/php-fpm.pid
 error_log = log/php-fpm.log
-log_level = warning 
+log_level = warning
 
 emergency_restart_threshold = 30
-emergency_restart_interval = 60s 
+emergency_restart_interval = 60s
 process_control_timeout = 5s
 daemonize = yes
 
@@ -193,11 +193,11 @@ daemonize = yes
 listen = /dev/shm/php-cgi.sock
 listen.backlog = -1
 listen.allowed_clients = 127.0.0.1
-listen.owner = $run_user 
-listen.group = $run_user 
+listen.owner = $run_user
+listen.group = $run_user
 listen.mode = 0666
-user = $run_user 
-group = $run_user 
+user = $run_user
+group = $run_user
 
 pm = dynamic
 pm.max_children = 12
@@ -222,7 +222,7 @@ env[TMPDIR] = /tmp
 env[TEMP] = /tmp
 EOF
 
-    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf 
+    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf
 
     if [ $Mem -le 3000 ];then
         sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
@@ -251,7 +251,7 @@ 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 
+    #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf
     service php-fpm start
 
 elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then

+ 14 - 14
include/php-5.4.sh

@@ -24,7 +24,7 @@ cd libiconv-$libiconv_version
 ./configure --prefix=/usr/local
 make && make install
 cd ..
-rm -rf libiconv-$libiconv_version 
+rm -rf libiconv-$libiconv_version
 
 tar xzf libmcrypt-$libmcrypt_version.tar.gz
 cd libmcrypt-$libmcrypt_version
@@ -35,14 +35,14 @@ cd libltdl
 ./configure --enable-ltdl-install
 make && make install
 cd ../../
-rm -rf libmcrypt-$libmcrypt_version 
+rm -rf libmcrypt-$libmcrypt_version
 
 tar xzf mhash-$mhash_version.tar.gz
 cd mhash-$mhash_version
 ./configure
 make && make install
 cd ..
-rm -rf mhash-$mhash_version 
+rm -rf mhash-$mhash_version
 
 echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
 ldconfig
@@ -54,10 +54,10 @@ ldconfig
 ./configure
 make && make install
 cd ..
-rm -rf mcrypt-$mcrypt_version 
+rm -rf mcrypt-$mcrypt_version
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf php-$php_4_version.tar.gz
 patch -d php-$php_4_version -p0 < fpm-race-condition.patch
@@ -98,7 +98,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $php_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$php_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -140,10 +140,10 @@ if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ]
 [global]
 pid = run/php-fpm.pid
 error_log = log/php-fpm.log
-log_level = warning 
+log_level = warning
 
 emergency_restart_threshold = 30
-emergency_restart_interval = 60s 
+emergency_restart_interval = 60s
 process_control_timeout = 5s
 daemonize = yes
 
@@ -155,11 +155,11 @@ daemonize = yes
 listen = /dev/shm/php-cgi.sock
 listen.backlog = -1
 listen.allowed_clients = 127.0.0.1
-listen.owner = $run_user 
-listen.group = $run_user 
+listen.owner = $run_user
+listen.group = $run_user
 listen.mode = 0666
-user = $run_user 
-group = $run_user 
+user = $run_user
+group = $run_user
 
 pm = dynamic
 pm.max_children = 12
@@ -184,7 +184,7 @@ env[TMPDIR] = /tmp
 env[TEMP] = /tmp
 EOF
 
-    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf 
+    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf
 
     if [ $Mem -le 3000 ];then
         sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
@@ -213,7 +213,7 @@ 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 
+    #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf
     service php-fpm start
 
 elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then

+ 12 - 12
include/php-5.5.sh

@@ -57,7 +57,7 @@ cd ..
 rm -rf mcrypt-$mcrypt_version
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 tar xzf php-$php_5_version.tar.gz
 patch -d php-$php_5_version -p0 < fpm-race-condition.patch
 cd php-$php_5_version
@@ -98,7 +98,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $php_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$php_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -154,10 +154,10 @@ if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ]
 [global]
 pid = run/php-fpm.pid
 error_log = log/php-fpm.log
-log_level = warning 
+log_level = warning
 
 emergency_restart_threshold = 30
-emergency_restart_interval = 60s 
+emergency_restart_interval = 60s
 process_control_timeout = 5s
 daemonize = yes
 
@@ -169,16 +169,16 @@ daemonize = yes
 listen = /dev/shm/php-cgi.sock
 listen.backlog = -1
 listen.allowed_clients = 127.0.0.1
-listen.owner = $run_user 
+listen.owner = $run_user
 listen.group = $run_user
 listen.mode = 0666
-user = $run_user 
-group = $run_user 
+user = $run_user
+group = $run_user
 
 pm = dynamic
-pm.max_children = 12 
-pm.start_servers = 8 
-pm.min_spare_servers = 6 
+pm.max_children = 12
+pm.start_servers = 8
+pm.min_spare_servers = 6
 pm.max_spare_servers = 12
 pm.max_requests = 2048
 pm.process_idle_timeout = 10s
@@ -198,7 +198,7 @@ env[TMPDIR] = /tmp
 env[TEMP] = /tmp
 EOF
 
-    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf 
+    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf
 
     if [ $Mem -le 3000 ];then
         sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
@@ -227,7 +227,7 @@ 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 
+    #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf
     service php-fpm start
 
 elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then

+ 11 - 11
include/php-5.6.sh

@@ -56,7 +56,7 @@ cd ..
 rm -rf mcrypt-$mcrypt_version
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf php-$php_6_version.tar.gz
 cd php-$php_6_version
@@ -97,7 +97,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $php_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$php_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -153,10 +153,10 @@ if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ]
 [global]
 pid = run/php-fpm.pid
 error_log = log/php-fpm.log
-log_level = warning 
+log_level = warning
 
 emergency_restart_threshold = 30
-emergency_restart_interval = 60s 
+emergency_restart_interval = 60s
 process_control_timeout = 5s
 daemonize = yes
 
@@ -168,16 +168,16 @@ daemonize = yes
 listen = /dev/shm/php-cgi.sock
 listen.backlog = -1
 listen.allowed_clients = 127.0.0.1
-listen.owner = $run_user 
+listen.owner = $run_user
 listen.group = $run_user
 listen.mode = 0666
-user = $run_user 
+user = $run_user
 group = $run_user
 
 pm = dynamic
-pm.max_children = 12 
-pm.start_servers = 8 
-pm.min_spare_servers = 6 
+pm.max_children = 12
+pm.start_servers = 8
+pm.min_spare_servers = 6
 pm.max_spare_servers = 12
 pm.max_requests = 2048
 pm.process_idle_timeout = 10s
@@ -197,7 +197,7 @@ env[TMPDIR] = /tmp
 env[TEMP] = /tmp
 EOF
 
-    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf 
+    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf
 
     if [ $Mem -le 3000 ];then
         sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
@@ -226,7 +226,7 @@ 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 
+    #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf
     service php-fpm start
 
 elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then

+ 14 - 14
include/php-7.sh

@@ -56,9 +56,9 @@ cd ..
 rm -rf mcrypt-$mcrypt_version
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
-tar xzf php-$php_7_version.tar.gz 
+tar xzf php-$php_7_version.tar.gz
 cd php-$php_7_version
 make clean
 ./buildconf
@@ -98,7 +98,7 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$php_install_dir/bin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $php_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$php_install_dir/bin:\1@" /etc/profile
 . /etc/profile
 
@@ -159,10 +159,10 @@ if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ]
 [global]
 pid = run/php-fpm.pid
 error_log = log/php-fpm.log
-log_level = warning 
+log_level = warning
 
 emergency_restart_threshold = 30
-emergency_restart_interval = 60s 
+emergency_restart_interval = 60s
 process_control_timeout = 5s
 daemonize = yes
 
@@ -174,16 +174,16 @@ daemonize = yes
 listen = /dev/shm/php-cgi.sock
 listen.backlog = -1
 listen.allowed_clients = 127.0.0.1
-listen.owner = $run_user 
-listen.group = $run_user 
+listen.owner = $run_user
+listen.group = $run_user
 listen.mode = 0666
-user = $run_user 
-group = $run_user 
+user = $run_user
+group = $run_user
 
 pm = dynamic
-pm.max_children = 12 
-pm.start_servers = 8 
-pm.min_spare_servers = 6 
+pm.max_children = 12
+pm.start_servers = 8
+pm.min_spare_servers = 6
 pm.max_spare_servers = 12
 pm.max_requests = 2048
 pm.process_idle_timeout = 10s
@@ -203,7 +203,7 @@ env[TMPDIR] = /tmp
 env[TEMP] = /tmp
 EOF
 
-    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf 
+    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf
 
     if [ $Mem -le 3000 ];then
         sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
@@ -232,7 +232,7 @@ 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 
+    #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf
     service php-fpm start
 
 elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then

+ 4 - 4
include/pureftpd.sh

@@ -34,12 +34,12 @@ if [ -e "$pureftpd_install_dir/sbin/pure-ftpwho" ];then
     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; [ -z "`grep ^'# Default-Start' /etc/init.d/pureftpd`" ] && sed -i "s@^# chkconfig.*@# chkconfig&\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6@" /etc/init.d/pureftpd; update-rc.d pureftpd defaults; }
-    [ "$Debian_version" == '7' ] && sed -i 's@/var/lock/subsys/@/var/lock/@g' /etc/init.d/pureftpd 
+    [ "$Debian_version" == '7' ] && sed -i 's@/var/lock/subsys/@/var/lock/@g' /etc/init.d/pureftpd
     cd ../../
 
     /bin/cp config/pure-ftpd.conf $pureftpd_install_dir/etc
-    sed -i "s@^PureDB.*@PureDB	$pureftpd_install_dir/etc/pureftpd.pdb@" $pureftpd_install_dir/etc/pure-ftpd.conf
-    sed -i "s@^LimitRecursion.*@LimitRecursion	65535 8@" $pureftpd_install_dir/etc/pure-ftpd.conf
+    sed -i "s@^PureDB.*@PureDB  $pureftpd_install_dir/etc/pureftpd.pdb@" $pureftpd_install_dir/etc/pure-ftpd.conf
+    sed -i "s@^LimitRecursion.*@LimitRecursion  65535 8@" $pureftpd_install_dir/etc/pure-ftpd.conf
     ulimit -s unlimited
     service pureftpd start
 
@@ -50,7 +50,7 @@ if [ -e "$pureftpd_install_dir/sbin/pure-ftpwho" ];then
             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 [[ $OS =~ ^Ubuntu$|^Debian$ ]];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

+ 2 - 2
include/redis.sh

@@ -36,8 +36,8 @@ if [ -f "src/redis-server" ];then
     echo "${CSUCCESS}Redis-server install successfully! ${CEND}"
     cd ..
     rm -rf redis-$redis_version
-    [ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Redis-server-init-CentOS /etc/init.d/redis-server; chkconfig --add redis-server; chkconfig redis-server on; } 
-    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && { useradd -M -s /sbin/nologin redis; chown -R redis:redis $redis_install_dir/var/; /bin/cp ../init.d/Redis-server-init-Ubuntu /etc/init.d/redis-server; update-rc.d redis-server defaults; } 
+    [ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Redis-server-init-CentOS /etc/init.d/redis-server; chkconfig --add redis-server; chkconfig redis-server on; }
+    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && { useradd -M -s /sbin/nologin redis; chown -R redis:redis $redis_install_dir/var/; /bin/cp ../init.d/Redis-server-init-Ubuntu /etc/init.d/redis-server; update-rc.d redis-server defaults; }
     sed -i "s@/usr/local/redis@$redis_install_dir@g" /etc/init.d/redis-server
     #[ -z "`grep 'vm.overcommit_memory' /etc/sysctl.conf`" ] && echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
     #sysctl -p

+ 1 - 1
include/tcmalloc.sh

@@ -12,7 +12,7 @@ Install_tcmalloc() {
 cd $oneinstack_dir/src
 src_url=http://mirrors.linuxeye.com/oneinstack/src/gperftools-$tcmalloc_version.tar.gz && Download_src
 
-tar xzf gperftools-$tcmalloc_version.tar.gz 
+tar xzf gperftools-$tcmalloc_version.tar.gz
 cd gperftools-$tcmalloc_version
 ./configure --enable-frame-pointers
 make && make install

+ 8 - 8
include/tengine.sh

@@ -14,11 +14,11 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz &&
 src_url=http://tengine.taobao.org/download/tengine-$tengine_version.tar.gz && Download_src
 
 id -u $run_user >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user 
+[ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
 
 tar xzf pcre-$pcre_version.tar.gz
-tar xzf tengine-$tengine_version.tar.gz 
-cd tengine-$tengine_version 
+tar xzf tengine-$tengine_version.tar.gz
+cd tengine-$tengine_version
 # Modify Tengine version
 #sed -i 's@TENGINE "/" TENGINE_VERSION@"Tengine/unknown"@' src/core/nginx.h
 
@@ -38,7 +38,7 @@ fi
 make && make install
 if [ -e "$tengine_install_dir/conf/nginx.conf" ];then
     cd ..
-    rm -rf tengine-$tengine_version 
+    rm -rf tengine-$tengine_version
     echo "${CSUCCESS}Tengine install successfully! ${CEND}"
 else
     rm -rf $tengine_install_dir
@@ -46,12 +46,12 @@ else
     kill -9 $$
 fi
 
-[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$tengine_install_dir/sbin:\$PATH" >> /etc/profile 
+[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$tengine_install_dir/sbin:\$PATH" >> /etc/profile
 [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $tengine_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$tengine_install_dir/sbin:\1@" /etc/profile
 . /etc/profile
 
-[ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; } 
-[[ $OS =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; update-rc.d nginx defaults; } 
+[ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+[[ $OS =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; update-rc.d nginx defaults; }
 cd ..
 
 sed -i "s@/usr/local/nginx@$tengine_install_dir@g" /etc/init.d/nginx
@@ -84,7 +84,7 @@ EOF
 sed -i "s@/data/wwwroot/default@$wwwroot_dir/default@" $tengine_install_dir/conf/nginx.conf
 sed -i "s@/data/wwwlogs@$wwwlogs_dir@g" $tengine_install_dir/conf/nginx.conf
 sed -i "s@^user www www@user $run_user $run_user@" $tengine_install_dir/conf/nginx.conf
-[ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $tengine_install_dir/conf/nginx.conf 
+[ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $tengine_install_dir/conf/nginx.conf
 uname -r | awk -F'.' '{if ($1$2>=39)S=0;else S=1}{exit S}' && [ -z "`grep 'reuse_port on;' $tengine_install_dir/conf/nginx.conf`" ] && sed -i "s@worker_connections 51200;@worker_connections 51200;\n    reuse_port on;@" $tengine_install_dir/conf/nginx.conf
 
 # worker_cpu_affinity

+ 12 - 12
include/tomcat-7.sh

@@ -26,18 +26,18 @@ rm -rf $tomcat_install_dir/webapps/{docs,examples,host-manager,manager,ROOT/*}
 if [ -e "$tomcat_install_dir/conf/server.xml" ];then
     /bin/cp catalina-jmx-remote.jar $tomcat_install_dir/lib
     cd $tomcat_install_dir/lib
-    [ ! -d "$tomcat_install_dir/lib/catalina" ] &&  mkdir $tomcat_install_dir/lib/catalina 
+    [ ! -d "$tomcat_install_dir/lib/catalina" ] &&  mkdir $tomcat_install_dir/lib/catalina
     cd $tomcat_install_dir/lib/catalina
     jar xf ../catalina.jar
     sed -i 's@^server.info=.*@server.info=Tomcat@' org/apache/catalina/util/ServerInfo.properties
     sed -i 's@^server.number=.*@server.number=7@' org/apache/catalina/util/ServerInfo.properties
     sed -i "s@^server.built=.*@server.built=`date`@" org/apache/catalina/util/ServerInfo.properties
     jar cf ../catalina.jar ./*
-    cd ../../bin 
-    rm -rf $tomcat_install_dir/lib/catalina 
-    [ "$OS" == 'CentOS' ] && yum -y install apr apr-devel 
+    cd ../../bin
+    rm -rf $tomcat_install_dir/lib/catalina
+    [ "$OS" == 'CentOS' ] && yum -y install apr apr-devel
     [[ $OS =~ ^Ubuntu$|^Debian$ ]] && apt-get -y install libapr1-dev libaprutil1-dev
-    tar xzf tomcat-native.tar.gz 
+    tar xzf tomcat-native.tar.gz
     cd tomcat-native-*-src/jni/native/
     rm -rf /usr/local/apr
     ./configure --with-apr=/usr/bin/apr-1-config
@@ -54,7 +54,7 @@ CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
 EOF
         cd ../../../;rm -rf tomcat-native-*
         chmod +x $tomcat_install_dir/bin/*.sh
-        /bin/mv $tomcat_install_dir/conf/server.xml{,_bk} 
+        /bin/mv $tomcat_install_dir/conf/server.xml{,_bk}
         cd $oneinstack_dir/src
         /bin/cp ../config/server.xml $tomcat_install_dir/conf
         sed -i "s@/usr/local/tomcat@$tomcat_install_dir@g" $tomcat_install_dir/conf/server.xml
@@ -65,7 +65,7 @@ EOF
                     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 [[ $OS =~ ^Ubuntu$|^Debian$ ]];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
@@ -81,7 +81,7 @@ EOF
          prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
 </Host>
 EOF
-        # logrotate tomcat catalina.out 
+        # logrotate tomcat catalina.out
         cat > /etc/logrotate.d/tomcat << EOF
 $tomcat_install_dir/logs/catalina.out {
 daily
@@ -101,7 +101,7 @@ controlRole   readwrite \
               unregister
 EOF
         cat > $tomcat_install_dir/conf/jmxremote.password << EOF
-monitorRole  `cat /dev/urandom | head -1 | md5sum | head -c 8` 
+monitorRole  `cat /dev/urandom | head -1 | md5sum | head -c 8`
 # controlRole   R&D
 EOF
         chown -R $run_user.$run_user $tomcat_install_dir
@@ -109,13 +109,13 @@ 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 
+        [ "$OS" == 'CentOS' ] && { chkconfig --add tomcat; chkconfig tomcat on; }
+        [[ $OS =~ ^Ubuntu$|^Debian$ ]] && update-rc.d tomcat defaults
         echo "${CSUCCESS}Tomcat install successfully! ${CEND}"
     fi
 else
     rm -rf $tomcat_install_dir
-    echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}" 
+    echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}"
     kill -9 $$
 fi
 service tomcat start

+ 12 - 12
include/tomcat-8.sh

@@ -26,18 +26,18 @@ rm -rf $tomcat_install_dir/webapps/{docs,examples,host-manager,manager,ROOT/*}
 if [ -e "$tomcat_install_dir/conf/server.xml" ];then
     /bin/cp catalina-jmx-remote.jar $tomcat_install_dir/lib
     cd $tomcat_install_dir/lib
-    [ ! -d "$tomcat_install_dir/lib/catalina" ] &&  mkdir $tomcat_install_dir/lib/catalina 
+    [ ! -d "$tomcat_install_dir/lib/catalina" ] &&  mkdir $tomcat_install_dir/lib/catalina
     cd $tomcat_install_dir/lib/catalina
     jar xf ../catalina.jar
     sed -i 's@^server.info=.*@server.info=Tomcat@' org/apache/catalina/util/ServerInfo.properties
     sed -i 's@^server.number=.*@server.number=8@' org/apache/catalina/util/ServerInfo.properties
     sed -i "s@^server.built=.*@server.built=`date`@" org/apache/catalina/util/ServerInfo.properties
     jar cf ../catalina.jar ./*
-    cd ../../bin 
-    rm -rf $tomcat_install_dir/lib/catalina 
-    [ "$OS" == 'CentOS' ] && yum -y install apr apr-devel 
-    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && apt-get -y install libapr1-dev libaprutil1-dev 
-    tar xzf tomcat-native.tar.gz 
+    cd ../../bin
+    rm -rf $tomcat_install_dir/lib/catalina
+    [ "$OS" == 'CentOS' ] && yum -y install apr apr-devel
+    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && apt-get -y install libapr1-dev libaprutil1-dev
+    tar xzf tomcat-native.tar.gz
     cd tomcat-native-*-src/jni/native/
     rm -rf /usr/local/apr
     ./configure --with-apr=/usr/bin/apr-1-config
@@ -54,7 +54,7 @@ CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
 EOF
         cd ../../../;rm -rf tomcat-native-*
         chmod +x $tomcat_install_dir/bin/*.sh
-        /bin/mv $tomcat_install_dir/conf/server.xml{,_bk} 
+        /bin/mv $tomcat_install_dir/conf/server.xml{,_bk}
         cd $oneinstack_dir/src
         /bin/cp ../config/server.xml $tomcat_install_dir/conf
         sed -i "s@/usr/local/tomcat@$tomcat_install_dir@g" $tomcat_install_dir/conf/server.xml
@@ -65,7 +65,7 @@ EOF
                     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 [[ $OS =~ ^Ubuntu$|^Debian$ ]];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
@@ -77,7 +77,7 @@ EOF
         cat > $tomcat_install_dir/conf/vhost/localhost.xml << EOF
 <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
   <Context path="" docBase="$wwwroot_dir/default" debug="0" reloadable="false" crossContext="true"/>
-  <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
+  <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
          prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
 </Host>
 EOF
@@ -101,7 +101,7 @@ controlRole   readwrite \
               unregister
 EOF
         cat > $tomcat_install_dir/conf/jmxremote.password << EOF
-monitorRole  `cat /dev/urandom | head -1 | md5sum | head -c 8` 
+monitorRole  `cat /dev/urandom | head -1 | md5sum | head -c 8`
 # controlRole   R&D
 EOF
         chown -R $run_user.$run_user $tomcat_install_dir
@@ -109,13 +109,13 @@ 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" == 'CentOS' ] && { chkconfig --add tomcat;chkconfig tomcat on; }
         [[ $OS =~ ^Ubuntu$|^Debian$ ]] && update-rc.d tomcat defaults
         echo "${CSUCCESS}Tomcat install successfully! ${CEND}"
     fi
 else
     rm -rf $tomcat_install_dir
-    echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}" 
+    echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}"
     kill -9 $$
 fi
 service tomcat start

+ 8 - 8
include/upgrade_db.sh

@@ -77,7 +77,7 @@ do
             DB_URL=$DOWN_ADDR/MySQL-`echo $NEW_DB_version | awk -F. '{print $1"."$2}'`/$DB_name.tar.gz
         fi
             [ ! -e "$DB_name.tar.gz" ] && wget --no-check-certificate -c $DB_URL > /dev/null 2>&1
-            
+
             if [ -e "$DB_name.tar.gz" ];then
                 echo "Download [${CMSG}$DB_name.tar.gz${CEND}] successfully! "
             else
@@ -93,7 +93,7 @@ if [ -e "$DB_name.tar.gz" ];then
     echo "[${CMSG}$DB_name.tar.gz${CEND}] found"
     echo "Press Ctrl+c to cancel or Press any key to continue..."
     char=`get_char`
-    if [ "$DB" == 'MariaDB' ];then 
+    if [ "$DB" == 'MariaDB' ];then
         service mysqld stop
         mv ${mariadb_install_dir}{,_old_`date +"%Y%m%d_%H%M%S"`}
         mv ${mariadb_data_dir}{,_old_`date +"%Y%m%d_%H%M%S"`}
@@ -109,16 +109,16 @@ if [ -e "$DB_name.tar.gz" ];then
         $mariadb_install_dir/scripts/mysql_install_db --user=mysql --basedir=$mariadb_install_dir --datadir=$mariadb_data_dir
         chown mysql.mysql -R $mariadb_data_dir
         service mysqld start
-        $mariadb_install_dir/bin/mysql < DB_all_backup_$(date +"%Y%m%d").sql 
+        $mariadb_install_dir/bin/mysql < DB_all_backup_$(date +"%Y%m%d").sql
         service mysqld restart
         $mariadb_install_dir/bin/mysql -uroot -p${dbrootpwd} -e "drop database test;" >/dev/null 2>&1
         $mariadb_install_dir/bin/mysql -uroot -p${dbrootpwd} -e "reset master;" >/dev/null 2>&1
         [ $? -eq 0 ] &&  echo "You have ${CMSG}successfully${CEND} upgrade from ${CMSG}$OLD_DB_version${CEND} to ${CMSG}$NEW_DB_version${CEND}"
     elif [ "$DB" == 'Percona' ];then
-        tar zxf $DB_name.tar.gz 
-    	cd $DB_name
-    	make clean
-    	if [ "`echo $NEW_DB_version | awk -F. '{print $1"."$2}'`" == '5.5' ];then
+        tar zxf $DB_name.tar.gz
+        cd $DB_name
+        make clean
+        if [ "`echo $NEW_DB_version | awk -F. '{print $1"."$2}'`" == '5.5' ];then
             cmake . -DCMAKE_INSTALL_PREFIX=$percona_install_dir \
 -DMYSQL_DATADIR=$percona_data_dir \
 -DSYSCONFDIR=/etc \
@@ -191,6 +191,6 @@ $EXE_LINKER
         $mysql_install_dir/bin/mysql -uroot -p${dbrootpwd} -e "drop database test;" >/dev/null 2>&1
         $mysql_install_dir/bin/mysql -uroot -p${dbrootpwd} -e "reset master;" >/dev/null 2>&1
         [ $? -eq 0 ] &&  echo "You have ${CMSG}successfully${CEND} upgrade from ${CMSG}$OLD_DB_version${CEND} to ${CMSG}$NEW_DB_version${CEND}"
-    fi 
+    fi
 fi
 }

+ 1 - 1
include/upgrade_phpmyadmin.sh

@@ -35,7 +35,7 @@ if [ -e "phpMyAdmin-${NEW_phpMyAdmin_version}-all-languages.tar.gz" ];then
     echo "[${CMSG}phpMyAdmin-${NEW_phpMyAdmin_version}-all-languages.tar.gz${CEND}] found"
     echo "Press Ctrl+c to cancel or Press any key to continue..."
     char=`get_char`
-    tar xzf phpMyAdmin-${NEW_phpMyAdmin_version}-all-languages.tar.gz 
+    tar xzf phpMyAdmin-${NEW_phpMyAdmin_version}-all-languages.tar.gz
     rm -rf $wwwroot_dir/default/phpMyAdmin
     /bin/mv phpMyAdmin-${NEW_phpMyAdmin_version}-all-languages $wwwroot_dir/default/phpMyAdmin
     /bin/cp $wwwroot_dir/default/phpMyAdmin/{config.sample.inc.php,config.inc.php}

+ 1 - 1
include/upgrade_redis.sh

@@ -51,7 +51,7 @@ if [ -e "redis-$NEW_Redis_version.tar.gz" ];then
         service redis-server start
         echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_Redis_version${CEND} to ${CWARNING}$NEW_Redis_version${CEND}"
     else
-        echo "${CFAILURE}Upgrade Redis failed! ${CEND}" 
+        echo "${CFAILURE}Upgrade Redis failed! ${CEND}"
     fi
     cd ..
 fi

+ 3 - 3
include/upgrade_web.sh

@@ -55,7 +55,7 @@ if [ -e "nginx-$NEW_Nginx_version.tar.gz" ];then
         kill -QUIT `cat /var/run/nginx.pid.oldbin`
         echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_Nginx_version${CEND} to ${CWARNING}$NEW_Nginx_version${CEND}"
     else
-        echo "${CFAILURE}Upgrade Nginx failed! ${CEND}" 
+        echo "${CFAILURE}Upgrade Nginx failed! ${CEND}"
     fi
     cd ..
 fi
@@ -114,7 +114,7 @@ if [ -e "tengine-$NEW_Tengine_version.tar.gz" ];then
         kill -QUIT `cat /var/run/nginx.pid.oldbin`
         echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_Tengine_version${CEND} to ${CWARNING}$NEW_Tengine_version${CEND}"
     else
-        echo "${CFAILURE}Upgrade Tengine failed! ${CEND}" 
+        echo "${CFAILURE}Upgrade Tengine failed! ${CEND}"
     fi
     cd ..
 fi
@@ -171,7 +171,7 @@ if [ -e "openresty-$NEW_OpenResty_version.tar.gz" ];then
         kill -QUIT `cat /var/run/nginx.pid.oldbin`
         echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_OpenResty_version${CEND} to ${CWARNING}$NEW_OpenResty_version${CEND}"
     else
-        echo "${CFAILURE}Upgrade OpenResty failed! ${CEND}" 
+        echo "${CFAILURE}Upgrade OpenResty failed! ${CEND}"
     fi
     cd ..
 fi

+ 3 - 3
include/xcache.sh

@@ -13,7 +13,7 @@ Install_XCache()
 cd $oneinstack_dir/src
 src_url=http://xcache.lighttpd.net/pub/Releases/$xcache_version/xcache-$xcache_version.tar.gz && Download_src
 
-tar xzf xcache-$xcache_version.tar.gz 
+tar xzf xcache-$xcache_version.tar.gz
 cd xcache-$xcache_version
 make clean
 $php_install_dir/bin/phpize
@@ -34,12 +34,12 @@ xcache.admin.pass="$xcache_admin_md5_pass"
 
 [xcache]
 xcache.size=$(expr $Memory_limit / 2)M
-xcache.count=$(expr `cat /proc/cpuinfo | grep -c processor` + 1) 
+xcache.count=$(expr `cat /proc/cpuinfo | grep -c processor` + 1)
 xcache.slots=8K
 xcache.ttl=3600
 xcache.gc_interval=300
 xcache.var_size=4M
-xcache.var_count=$(expr `cat /proc/cpuinfo | grep -c processor` + 1) 
+xcache.var_count=$(expr `cat /proc/cpuinfo | grep -c processor` + 1)
 xcache.var_slots=8K
 xcache.var_ttl=0
 xcache.var_maxttl=0

+ 2 - 2
include/zendopcache.sh

@@ -13,8 +13,8 @@ Install_ZendOPcache()
 cd $oneinstack_dir/src
 src_url=https://pecl.php.net/get/zendopcache-$zendopcache_version.tgz && Download_src
 
-tar xzf zendopcache-$zendopcache_version.tgz 
-cd zendopcache-$zendopcache_version 
+tar xzf zendopcache-$zendopcache_version.tgz
+cd zendopcache-$zendopcache_version
 make clean
 $php_install_dir/bin/phpize
 ./configure --with-php-config=$php_install_dir/bin/php-config

+ 1 - 1
init.d/Memcached-init-CentOS

@@ -42,7 +42,7 @@ stop () {
     echo
     if [ $RETVAL -eq 0 ] ; then
         rm -f /var/lock/subsys/memcached
-        rm -f /var/run/memcached/memcached.pid 
+        rm -f /var/run/memcached/memcached.pid
     fi
 }
 

+ 8 - 8
init.d/Memcached-init-Ubuntu

@@ -1,15 +1,15 @@
 #! /bin/sh
 #
- 
+
 PORT=11211
 USER=memcached
 MAXCONN=1024
 OPTIONS="-l 127.0.0.1"
 DAEMON=/usr/local/memcached/bin/memcached
- 
+
 RETVAL=0
 prog="/usr/local/memcached/bin/memcached"
- 
+
 start_instance() {
         echo -n $"Starting $prog ($1): "
         start-stop-daemon --start --quiet --pidfile /var/run/memcached/memcached.$1.pid --exec $DAEMON -- -d -p $PORT -u $USER  -m $2 -c $MAXCONN -P /var/run/memcached/memcached.$1.pid $OPTIONS
@@ -18,7 +18,7 @@ start_instance() {
         [ $RETVAL -eq 0 ] && touch /var/lock/memcached.$1
         PORT=`expr $PORT + 1`
 }
- 
+
 stop_instance() {
         echo -n $"Stopping $prog ($1): "
         start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/memcached/memcached.$1.pid --exec $DAEMON
@@ -35,7 +35,7 @@ start () {
         if [ "`stat -c %U /var/run/memcached`" != "$USER" ]; then
                 chown $USER /var/run/memcached
         fi
- 
+
         start_instance default 256;
         #start_instance block 16;
         #start_instance content 128;
@@ -57,12 +57,12 @@ stop () {
         #stop_instance update;
         #stop_instance views;
 }
- 
+
 restart () {
         stop
         start
 }
- 
+
 # See how we were called.
 case "$1" in
   start)
@@ -81,5 +81,5 @@ case "$1" in
         echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}"
         exit 1
 esac
- 
+
 exit $?

+ 20 - 20
init.d/Nginx-init-CentOS

@@ -2,31 +2,31 @@
 #
 # nginx - this script starts and stops the nginx daemon
 #
-# chkconfig:   - 85 15 
+# chkconfig:   - 85 15
 # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
 #               proxy and IMAP/POP3 proxy server
 # processname: nginx
-# config:      /usr/local/nginx/conf/nginx.conf 
+# config:      /usr/local/nginx/conf/nginx.conf
 # pidfile:     /var/run/nginx.pid
- 
+
 # Source function library.
 . /etc/rc.d/init.d/functions
- 
+
 # Source networking configuration.
 . /etc/sysconfig/network
- 
+
 # Check that networking is up.
 [ "$NETWORKING" = "no" ] && exit 0
- 
+
 nginx="/usr/local/nginx/sbin/nginx"
 prog=$(basename $nginx)
- 
+
 NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
- 
+
 [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
- 
+
 lockfile=/var/lock/subsys/nginx
- 
+
 make_dirs() {
    # make required directories
    user=`$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
@@ -44,7 +44,7 @@ make_dirs() {
        fi
    done
 }
- 
+
 start() {
     [ -x $nginx ] || exit 5
     [ -f $NGINX_CONF_FILE ] || exit 6
@@ -56,7 +56,7 @@ start() {
     [ $retval -eq 0 ] && touch $lockfile
     return $retval
 }
- 
+
 stop() {
     echo -n $"Stopping $prog: "
     killproc $prog -QUIT
@@ -65,14 +65,14 @@ stop() {
     [ $retval -eq 0 ] && rm -f $lockfile
     return $retval
 }
- 
+
 restart() {
     configtest || return $?
     stop
-    sleep 3 
+    sleep 3
     start
 }
- 
+
 reload() {
     configtest || return $?
     echo -n $"Reloading $prog: "
@@ -80,23 +80,23 @@ reload() {
     RETVAL=$?
     echo
 }
- 
+
 force_reload() {
     restart
 }
- 
+
 configtest() {
   $nginx -t -c $NGINX_CONF_FILE
 }
- 
+
 rh_status() {
     status $prog
 }
- 
+
 rh_status_q() {
     rh_status >/dev/null 2>&1
 }
- 
+
 case "$1" in
     start)
         rh_status_q && exit 0

+ 137 - 137
init.d/Nginx-init-Ubuntu

@@ -9,13 +9,13 @@
 # Description:       nginx init.d dash script for Ubuntu <=9.10.
 ### END INIT INFO
 #------------------------------------------------------------------------------
-# nginx - this Debian Almquist shell (dash) script, starts and stops the nginx 
+# nginx - this Debian Almquist shell (dash) script, starts and stops the nginx
 #         daemon for ubuntu 9.10 and lesser version numbered releases.
 #
 # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
 #               proxy and IMAP/POP3 proxy server.  This \
-#		script will manage the initiation of the \
-#		server and it's process state.
+#       script will manage the initiation of the \
+#       server and it's process state.
 #
 # processname: nginx
 # config:      /usr/local/nginx/conf/nginx.conf
@@ -27,77 +27,77 @@
 #
 # Version: 2.0 02-NOV-2009 jason.giedymin AT gmail.com
 # Notes: nginx init.d dash script for Ubuntu <=9.10.
-# 
+#
 # This script's project home is:
-# 	http://code.google.com/p/nginx-init-ubuntu/
+#   http://code.google.com/p/nginx-init-ubuntu/
 #
 #------------------------------------------------------------------------------
 #                               Functions
 #------------------------------------------------------------------------------
 . /lib/lsb/init-functions
- 
+
 #------------------------------------------------------------------------------
 #                               Consts
 #------------------------------------------------------------------------------
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/local/nginx/sbin/nginx
- 
+
 PS="nginx"
-PIDNAME="nginx"				#lets you do $PS-slave
+PIDNAME="nginx"             #lets you do $PS-slave
 PIDFILE=$PIDNAME.pid                    #pid file
 PIDSPATH=/var/run
- 
+
 DESCRIPTION="Nginx Server..."
- 
+
 RUNAS=root                              #user to run as
- 
+
 SCRIPT_OK=0                             #ala error codes
 SCRIPT_ERROR=1                          #ala error codes
 TRUE=1                                  #boolean
 FALSE=0                                 #boolean
- 
+
 lockfile=/var/lock/subsys/nginx
 NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
- 
+
 #------------------------------------------------------------------------------
 #                               Simple Tests
 #------------------------------------------------------------------------------
- 
+
 #test if nginx is a file and executable
 test -x $DAEMON || exit 0
- 
+
 # Include nginx defaults if available
 if [ -f /etc/default/nginx ] ; then
         . /etc/default/nginx
 fi
- 
+
 #set exit condition
 #set -e
- 
+
 #------------------------------------------------------------------------------
 #                               Functions
 #------------------------------------------------------------------------------
- 
+
 setFilePerms(){
- 
+
         if [ -f $PIDSPATH/$PIDFILE ]; then
                 chmod 400 $PIDSPATH/$PIDFILE
         fi
 }
- 
+
 configtest() {
-	$DAEMON -t -c $NGINX_CONF_FILE
+    $DAEMON -t -c $NGINX_CONF_FILE
 }
- 
+
 getPSCount() {
-	return `pgrep -f $PS | wc -l`
+    return `pgrep -f $PS | wc -l`
 }
- 
+
 isRunning() {
         if [ $1 ]; then
                 pidof_daemon $1
                 PID=$?
- 
+
                 if [ $PID -gt 0 ]; then
                         return 1
                 else
@@ -106,7 +106,7 @@ isRunning() {
         else
                 pidof_daemon
                 PID=$?
- 
+
                 if [ $PID -gt 0 ]; then
                         return 1
                 else
@@ -114,13 +114,13 @@ isRunning() {
                 fi
         fi
 }
- 
+
 #courtesy of php-fpm
 wait_for_pid () {
         try=0
- 
+
         while test $try -lt 35 ; do
- 
+
                 case "$1" in
                         'created')
                         if [ -f "$2" ] ; then
@@ -128,7 +128,7 @@ wait_for_pid () {
                                 break
                         fi
                         ;;
- 
+
                         'removed')
                         if [ ! -f "$2" ] ; then
                                 try=''
@@ -136,45 +136,45 @@ wait_for_pid () {
                         fi
                         ;;
                 esac
- 
+
                 #echo -n .
                 try=`expr $try + 1`
                 sleep 1
         done
 }
- 
+
 status(){
-	isRunning
-	isAlive=$?
- 
-	if [ "${isAlive}" -eq $TRUE ]; then
+    isRunning
+    isAlive=$?
+
+    if [ "${isAlive}" -eq $TRUE ]; then
                 echo "$PIDNAME found running with processes:  `pidof $PS`"
         else
                 echo "$PIDNAME is NOT running."
         fi
- 
- 
+
+
 }
- 
+
 removePIDFile(){
-	if [ $1 ]; then
+    if [ $1 ]; then
                 if [ -f $1 ]; then
-        	        rm -f $1
-	        fi
+                    rm -f $1
+            fi
         else
-		#Do default removal
-		if [ -f $PIDSPATH/$PIDFILE ]; then
-        	        rm -f $PIDSPATH/$PIDFILE
-	        fi
+        #Do default removal
+        if [ -f $PIDSPATH/$PIDFILE ]; then
+                    rm -f $PIDSPATH/$PIDFILE
+            fi
         fi
 }
- 
+
 start() {
         log_daemon_msg "Starting $DESCRIPTION"
- 
-	isRunning
-	isAlive=$?
- 
+
+    isRunning
+    isAlive=$?
+
         if [ "${isAlive}" -eq $TRUE ]; then
                 log_end_msg $SCRIPT_ERROR
         else
@@ -184,109 +184,109 @@ start() {
                 log_end_msg $SCRIPT_OK
         fi
 }
- 
+
 stop() {
-	log_daemon_msg "Stopping $DESCRIPTION"
- 
-	isRunning
-	isAlive=$?
+    log_daemon_msg "Stopping $DESCRIPTION"
+
+    isRunning
+    isAlive=$?
         if [ "${isAlive}" -eq $TRUE ]; then
                 start-stop-daemon --stop --quiet --pidfile $PIDSPATH/$PIDFILE
- 
-		wait_for_pid 'removed' $PIDSPATH/$PIDFILE
- 
+
+        wait_for_pid 'removed' $PIDSPATH/$PIDFILE
+
                 if [ -n "$try" ] ; then
                         log_end_msg $SCRIPT_ERROR
                 else
                         removePIDFile
-	                log_end_msg $SCRIPT_OK
+                    log_end_msg $SCRIPT_OK
                 fi
- 
+
         else
                 log_end_msg $SCRIPT_ERROR
         fi
 }
- 
+
 reload() {
-	configtest || return $?
- 
-	log_daemon_msg "Reloading (via HUP) $DESCRIPTION"
- 
+    configtest || return $?
+
+    log_daemon_msg "Reloading (via HUP) $DESCRIPTION"
+
         isRunning
         if [ $? -eq $TRUE ]; then
-		`killall -HUP $PS` #to be safe
- 
+        `killall -HUP $PS` #to be safe
+
                 log_end_msg $SCRIPT_OK
         else
                 log_end_msg $SCRIPT_ERROR
         fi
 }
- 
+
 quietupgrade() {
-	log_daemon_msg "Peforming Quiet Upgrade $DESCRIPTION"
- 
+    log_daemon_msg "Peforming Quiet Upgrade $DESCRIPTION"
+
         isRunning
         isAlive=$?
         if [ "${isAlive}" -eq $TRUE ]; then
-		kill -USR2 `cat $PIDSPATH/$PIDFILE`
-		kill -WINCH `cat $PIDSPATH/$PIDFILE.oldbin`
- 
-		isRunning
-		isAlive=$?
-		if [ "${isAlive}" -eq $TRUE ]; then
-			kill -QUIT `cat $PIDSPATH/$PIDFILE.oldbin`
-			wait_for_pid 'removed' $PIDSPATH/$PIDFILE.oldbin
+        kill -USR2 `cat $PIDSPATH/$PIDFILE`
+        kill -WINCH `cat $PIDSPATH/$PIDFILE.oldbin`
+
+        isRunning
+        isAlive=$?
+        if [ "${isAlive}" -eq $TRUE ]; then
+            kill -QUIT `cat $PIDSPATH/$PIDFILE.oldbin`
+            wait_for_pid 'removed' $PIDSPATH/$PIDFILE.oldbin
                         removePIDFile $PIDSPATH/$PIDFILE.oldbin
- 
-			log_end_msg $SCRIPT_OK
-		else
-			log_end_msg $SCRIPT_ERROR
- 
-			log_daemon_msg "ERROR! Reverting back to original $DESCRIPTION"
- 
-			kill -HUP `cat $PIDSPATH/$PIDFILE`
-			kill -TERM `cat $PIDSPATH/$PIDFILE.oldbin`
-			kill -QUIT `cat $PIDSPATH/$PIDFILE.oldbin`
- 
-			wait_for_pid 'removed' $PIDSPATH/$PIDFILE.oldbin
+
+            log_end_msg $SCRIPT_OK
+        else
+            log_end_msg $SCRIPT_ERROR
+
+            log_daemon_msg "ERROR! Reverting back to original $DESCRIPTION"
+
+            kill -HUP `cat $PIDSPATH/$PIDFILE`
+            kill -TERM `cat $PIDSPATH/$PIDFILE.oldbin`
+            kill -QUIT `cat $PIDSPATH/$PIDFILE.oldbin`
+
+            wait_for_pid 'removed' $PIDSPATH/$PIDFILE.oldbin
                         removePIDFile $PIDSPATH/$PIDFILE.oldbin
- 
-			log_end_msg $SCRIPT_ok
-		fi
+
+            log_end_msg $SCRIPT_ok
+        fi
         else
                 log_end_msg $SCRIPT_ERROR
         fi
 }
- 
+
 terminate() {
         log_daemon_msg "Force terminating (via KILL) $DESCRIPTION"
- 
-	PIDS=`pidof $PS` || true
- 
-	[ -e $PIDSPATH/$PIDFILE ] && PIDS2=`cat $PIDSPATH/$PIDFILE`
- 
-	for i in $PIDS; do
-		if [ "$i" = "$PIDS2" ]; then
-	        	kill $i
+
+    PIDS=`pidof $PS` || true
+
+    [ -e $PIDSPATH/$PIDFILE ] && PIDS2=`cat $PIDSPATH/$PIDFILE`
+
+    for i in $PIDS; do
+        if [ "$i" = "$PIDS2" ]; then
+                kill $i
                         wait_for_pid 'removed' $PIDSPATH/$PIDFILE
-			removePIDFile
-		fi
-	done
- 
-	log_end_msg $SCRIPT_OK
+            removePIDFile
+        fi
+    done
+
+    log_end_msg $SCRIPT_OK
 }
- 
+
 destroy() {
-	log_daemon_msg "Force terminating and may include self (via KILLALL) $DESCRIPTION"
-	killall $PS -q >> /dev/null 2>&1
-	log_end_msg $SCRIPT_OK
+    log_daemon_msg "Force terminating and may include self (via KILLALL) $DESCRIPTION"
+    killall $PS -q >> /dev/null 2>&1
+    log_end_msg $SCRIPT_OK
 }
- 
+
 pidof_daemon() {
     PIDS=`pidof $PS` || true
- 
+
     [ -e $PIDSPATH/$PIDFILE ] && PIDS2=`cat $PIDSPATH/$PIDFILE`
- 
+
     for i in $PIDS; do
         if [ "$i" = "$PIDS2" ]; then
             return 1
@@ -294,43 +294,43 @@ pidof_daemon() {
     done
     return 0
 }
- 
+
 case "$1" in
   start)
-	start
+    start
         ;;
   stop)
-	stop
+    stop
         ;;
   restart|force-reload)
-	stop
-	sleep 3 
-	start
+    stop
+    sleep 3
+    start
         ;;
   reload)
-	$1
-	;;
+    $1
+    ;;
   status)
-	status
-	;;
+    status
+    ;;
   configtest)
         $1
         ;;
   quietupgrade)
-	$1
-	;;
+    $1
+    ;;
   terminate)
-	$1
-	;;
+    $1
+    ;;
   destroy)
-	$1
-	;;
+    $1
+    ;;
   *)
-	FULLPATH=/etc/init.d/$PS
-	echo "Usage: $FULLPATH {start|stop|restart|force-reload|status|configtest|quietupgrade|terminate|destroy}"
-	echo "       The 'destroy' command should only be used as a last resort." 
-	exit 1
-	;;
+    FULLPATH=/etc/init.d/$PS
+    echo "Usage: $FULLPATH {start|stop|restart|force-reload|status|configtest|quietupgrade|terminate|destroy}"
+    echo "       The 'destroy' command should only be used as a last resort."
+    exit 1
+    ;;
 esac
- 
+
 exit 0

+ 3 - 3
init.d/Redis-server-init-CentOS

@@ -2,10 +2,10 @@
 #
 # redis - this script starts and stops the redis-server daemon
 #
-# chkconfig:   - 85 15 
+# chkconfig:   - 85 15
 # description:  Redis is a persistent key-value database
 # processname: redis-server
-# config:      /usr/local/redis/etc/redis.conf 
+# config:      /usr/local/redis/etc/redis.conf
 # config:      /etc/sysconfig/redis
 # pidfile:     /var/run/redis.pid
 
@@ -95,7 +95,7 @@ case "$1" in
         ;;
     condrestart|try-restart)
         rh_status_q || exit 0
-	    ;;
+        ;;
     *)
         echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
         exit 2

+ 34 - 34
init.d/Redis-server-init-Ubuntu

@@ -1,14 +1,14 @@
 #! /bin/sh
 ### BEGIN INIT INFO
-# Provides:		redis-server
-# Required-Start:	$syslog
-# Required-Stop:	$syslog
-# Should-Start:		$local_fs
-# Should-Stop:		$local_fs
-# Default-Start:	2 3 4 5
-# Default-Stop:		0 1 6
-# Short-Description:	redis-server - Persistent key-value db
-# Description:		redis-server - Persistent key-value db
+# Provides:     redis-server
+# Required-Start:   $syslog
+# Required-Stop:    $syslog
+# Should-Start:     $local_fs
+# Should-Stop:      $local_fs
+# Default-Start:    2 3 4 5
+# Default-Stop:     0 1 6
+# Short-Description:    redis-server - Persistent key-value db
+# Description:      redis-server - Persistent key-value db
 ### END INIT INFO
 
 
@@ -26,35 +26,35 @@ set -e
 
 case "$1" in
   start)
-	echo -n "Starting $DESC: "
-	touch $PIDFILE
-	chown redis:redis $PIDFILE
-	if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid redis:redis --exec $DAEMON -- $DAEMON_ARGS
-	then
-		echo "$NAME."
-	else
-		echo "failed"
-	fi
-	;;
+    echo -n "Starting $DESC: "
+    touch $PIDFILE
+    chown redis:redis $PIDFILE
+    if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid redis:redis --exec $DAEMON -- $DAEMON_ARGS
+    then
+        echo "$NAME."
+    else
+        echo "failed"
+    fi
+    ;;
   stop)
-	echo -n "Stopping $DESC: "
-	if start-stop-daemon --stop --retry 10 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
-	then
-		echo "$NAME."
-	else
-		echo "failed"
-	fi
-	rm -f $PIDFILE
-	;;
+    echo -n "Stopping $DESC: "
+    if start-stop-daemon --stop --retry 10 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
+    then
+        echo "$NAME."
+    else
+        echo "failed"
+    fi
+    rm -f $PIDFILE
+    ;;
 
   restart|force-reload)
-	${0} stop
-	${0} start
-	;;
+    ${0} stop
+    ${0} start
+    ;;
   *)
-	echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
-	exit 1
-	;;
+    echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
+    exit 1
+    ;;
 esac
 
 exit 0

+ 8 - 8
init.d/Shadowsocks-python-init

@@ -15,7 +15,7 @@ Shadowsocks_USAGE="Usage: $0 {\e[00;32mstart\e[00m|\e[00;31mstop\e[00m|\e[00;32m
 SHUTDOWN_WAIT=20
 
 Shadowsocks_pid(){
-	echo `ps -ef | grep $Shadowsocks_bin | grep -v grep | tr -s " "|cut -d" " -f2`
+  echo `ps -ef | grep $Shadowsocks_bin | grep -v grep | tr -s " "|cut -d" " -f2`
 }
 
 start() {
@@ -26,9 +26,9 @@ start() {
     $Shadowsocks_bin -c $Shadowsocks_conf -d start
     RETVAL=$?
     if [ "$RETVAL" = "0" ]; then
-    	echo -e "\e[00;32mStarting Shadowsocks\e[00m"
+      echo -e "\e[00;32mStarting Shadowsocks\e[00m"
     else
-    	echo -e "\e[00;32mShadowsocks start Failed\e[00m"
+      echo -e "\e[00;32mShadowsocks start Failed\e[00m"
     fi
     status
   fi
@@ -70,10 +70,10 @@ stop(){
 }
 
 case $1 in
-	start)
+  start)
           start
         ;;
-        stop)  
+        stop)
           stop
         ;;
         restart)
@@ -81,10 +81,10 @@ case $1 in
           start
         ;;
         status)
-	  status
+    status
         ;;
         *)
-	  echo -e $Shadowsocks_USAGE
+    echo -e $Shadowsocks_USAGE
         ;;
-esac    
+esac
 exit 0

+ 12 - 12
init.d/Supervisor-init-CentOS

@@ -69,26 +69,26 @@ running()
 
 start() {
         echo "Starting supervisord: "
-	
-        if [ -e $PIDFILE ]; then 
-		echo "ALREADY STARTED"
-		return 1
-	fi
 
-	# start supervisord with options from sysconfig (stuff like -c)
+        if [ -e $PIDFILE ]; then
+        echo "ALREADY STARTED"
+        return 1
+    fi
+
+    # start supervisord with options from sysconfig (stuff like -c)
         $SUPERVISORD $OPTIONS
-	
-	# show initial startup status
-	$SUPERVISORCTL $OPTIONS status
-	
-	# only create the subsyslock if we created the PIDFILE
+
+    # show initial startup status
+    $SUPERVISORCTL $OPTIONS status
+
+    # only create the subsyslock if we created the PIDFILE
         [ -e $PIDFILE ] && touch $LOCKFILE
 }
 
 stop() {
         echo -n "Stopping supervisord: "
         $SUPERVISORCTL $OPTIONS shutdown
-	if [ -n "$WAIT_FOR_SUBPROCESSES" ]; then 
+    if [ -n "$WAIT_FOR_SUBPROCESSES" ]; then
             echo "Waiting roughly 60 seconds for $PIDFILE to be removed after child processes exit"
             for sleep in  2 2 2 2 4 4 4 4 8 8 8 8 last; do
                 if [ ! -e $PIDFILE ] ; then

+ 5 - 5
init.d/Tomcat-init

@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 95 15 
+# chkconfig: - 95 15
 # description: Tomcat start/stop/status script
 
 #Location of JAVA_HOME (bin files)
@@ -89,7 +89,7 @@ case $1 in
           start
         ;;
 
-        stop)  
+        stop)
           stop
         ;;
 
@@ -99,11 +99,11 @@ case $1 in
         ;;
 
         status)
-	  status
+    status
         ;;
 
         *)
-	  echo -e $TOMCAT_USAGE
+    echo -e $TOMCAT_USAGE
         ;;
-esac    
+esac
 exit 0

+ 32 - 32
install.sh

@@ -30,7 +30,7 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 . ./include/get_char.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
 # get the IP information
 IPADDR=`./include/get_ipaddr.py`
@@ -44,7 +44,7 @@ mkdir -p $wwwroot_dir/default $wwwlogs_dir
 if [ -e "/etc/ssh/sshd_config" ];then
     [ -z "`grep ^Port /etc/ssh/sshd_config`" ] && ssh_port=22 || ssh_port=`grep ^Port /etc/ssh/sshd_config | awk '{print $2}'`
     while :; do echo
-        read -p "Please input SSH port(Default: $ssh_port): " SSH_PORT 
+        read -p "Please input SSH port(Default: $ssh_port): " SSH_PORT
         [ -z "$SSH_PORT" ] && SSH_PORT=$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
@@ -52,11 +52,11 @@ if [ -e "/etc/ssh/sshd_config" ];then
             echo "${CWARNING}input error! Input range: 22,1025~65534${CEND}"
         fi
     done
-    
+
     if [ -z "`grep ^Port /etc/ssh/sshd_config`" -a "$SSH_PORT" != '22' ];then
         sed -i "s@^#Port.*@&\nPort $SSH_PORT@" /etc/ssh/sshd_config
     elif [ -n "`grep ^Port /etc/ssh/sshd_config`" ];then
-        sed -i "s@^Port.*@Port $SSH_PORT@" /etc/ssh/sshd_config 
+        sed -i "s@^Port.*@Port $SSH_PORT@" /etc/ssh/sshd_config
     fi
 fi
 
@@ -96,7 +96,7 @@ while :; do echo
                 if [[ ! $Apache_version =~ ^[1-3]$ ]];then
                     echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
                 else
-                    [ "$Apache_version" != '3' -a -e "$apache_install_dir/conf/httpd.conf" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; Apache_version=Other; }  
+                    [ "$Apache_version" != '3' -a -e "$apache_install_dir/conf/httpd.conf" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; Apache_version=Other; }
                     break
                 fi
             done
@@ -111,7 +111,7 @@ while :; do echo
                 if [[ ! $Tomcat_version =~ ^[1-3]$ ]];then
                     echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
                 else
-                    [ "$Tomcat_version" != '3' -a -e "$tomcat_install_dir/conf/server.xml" ] && { echo "${CWARNING}Tomcat already installed! ${CEND}" ; Tomcat_version=Other; }  
+                    [ "$Tomcat_version" != '3' -a -e "$tomcat_install_dir/conf/server.xml" ] && { echo "${CWARNING}Tomcat already installed! ${CEND}" ; Tomcat_version=Other; }
                     if [ "$Tomcat_version" == '1' ];then
                         while :; do echo
                             echo 'Please select JDK version:'
@@ -207,11 +207,11 @@ while :; do echo
                     echo "${CWARNING}input error! Please only input number 1,2,3,4,5${CEND}"
                 else
                     while :; do echo
-                        read -p "Do you want to install opcode cache of the PHP? [y/n]: " PHP_cache_yn 
+                        read -p "Do you want to install opcode cache of the PHP? [y/n]: " PHP_cache_yn
                         if [[ ! $PHP_cache_yn =~ ^[y,n]$ ]];then
                             echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                         else
-                            if [ "$PHP_cache_yn" == 'y' ];then	
+                            if [ "$PHP_cache_yn" == 'y' ];then
                                 if [ $PHP_version == 1 ];then
                                     while :; do
                                         echo 'Please select a opcode cache of the PHP:'
@@ -306,7 +306,7 @@ while :; do echo
                             fi
                         done
                     fi
-        
+
                     if [ "$PHP_version" != '5' ];then
                         while :; do echo
                             read -p "Do you want to install ionCube? [y/n]: " ionCube_yn
@@ -317,7 +317,7 @@ while :; do echo
                             fi
                         done
                     fi
-        
+
                     # ImageMagick or GraphicsMagick
                     while :; do echo
                         read -p "Do you want to install ImageMagick or GraphicsMagick? [y/n]: " Magick_yn
@@ -368,7 +368,7 @@ if [[ $PHP_version =~ ^[1-5]$ ]] || [ -e "$php_install_dir/bin/phpize" ];then
         if [[ ! $phpMyAdmin_yn =~ ^[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}"; phpMyAdmin_yn=Other; } 
+            [ "$phpMyAdmin_yn" == 'y' -a -d "$wwwroot_dir/default/phpMyAdmin" ] && { echo "${CWARNING}phpMyAdmin already installed! ${CEND}"; phpMyAdmin_yn=Other; }
             break
         fi
     done
@@ -394,7 +394,7 @@ while :; do echo
     fi
 done
 
-# check jemalloc or tcmalloc 
+# check jemalloc or tcmalloc
 if [[ $Nginx_version =~ ^[1-3]$ ]] || [ "$DB_yn" == 'y' ];then
     while :; do echo
         read -p "Do you want to use jemalloc or tcmalloc optimize Database and Web server? [y/n]: " je_tc_malloc_yn
@@ -466,23 +466,23 @@ fi
 
 # Database
 if [ "$DB_version" == '1' ];then
-    . include/mysql-5.7.sh 
-    Install_MySQL-5-7 2>&1 | tee -a $oneinstack_dir/install.log 
+    . include/mysql-5.7.sh
+    Install_MySQL-5-7 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '2' ];then
-    . include/mysql-5.6.sh 
-    Install_MySQL-5-6 2>&1 | tee -a $oneinstack_dir/install.log 
+    . include/mysql-5.6.sh
+    Install_MySQL-5-6 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '3' ];then
     . include/mysql-5.5.sh
     Install_MySQL-5-5 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '4' ];then
     . include/mariadb-10.1.sh
-    Install_MariaDB-10-1 2>&1 | tee -a $oneinstack_dir/install.log 
+    Install_MariaDB-10-1 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '5' ];then
     . include/mariadb-10.0.sh
-    Install_MariaDB-10-0 2>&1 | tee -a $oneinstack_dir/install.log 
+    Install_MariaDB-10-0 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '6' ];then
     . include/mariadb-5.5.sh
-    Install_MariaDB-5-5 2>&1 | tee -a $oneinstack_dir/install.log 
+    Install_MariaDB-5-5 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '7' ];then
     . include/percona-5.7.sh
     Install_Percona-5-7 2>&1 | tee -a $oneinstack_dir/install.log
@@ -490,16 +490,16 @@ elif [ "$DB_version" == '8' ];then
     . include/percona-5.6.sh
     Install_Percona-5-6 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$DB_version" == '9' ];then
-    . include/percona-5.5.sh 
-    Install_Percona-5-5 2>&1 | tee -a $oneinstack_dir/install.log 
+    . include/percona-5.5.sh
+    Install_Percona-5-5 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
 # Apache
 if [ "$Apache_version" == '1' ];then
-    . include/apache-2.4.sh 
+    . include/apache-2.4.sh
     Install_Apache-2-4 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$Apache_version" == '2' ];then
-    . include/apache-2.2.sh 
+    . include/apache-2.2.sh
     Install_Apache-2-2 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
@@ -543,7 +543,7 @@ if [ "$PHP_cache" == '1' ] && [[ "$PHP_version" =~ ^[1,2]$ ]];then
     . include/zendopcache.sh
     Install_ZendOPcache 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$PHP_cache" == '2' ];then
-    . include/xcache.sh 
+    . include/xcache.sh
     Install_XCache 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$PHP_cache" == '3' ];then
     . include/apcu.sh
@@ -597,7 +597,7 @@ fi
 # Pure-FTPd
 if [ "$FTP_yn" == 'y' ];then
     . include/pureftpd.sh
-    Install_PureFTPd 2>&1 | tee -a $oneinstack_dir/install.log 
+    Install_PureFTPd 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
 # phpMyAdmin
@@ -624,7 +624,7 @@ 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 
+    DEMO 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
 # get web_install_dir and db_install_dir
@@ -633,17 +633,17 @@ fi
 
 # HHVM
 if [ "$HHVM_yn" == 'y' ];then
-    . include/hhvm_CentOS.sh 
-    Install_hhvm_CentOS 2>&1 | tee -a $oneinstack_dir/install.log 
+    . include/hhvm_CentOS.sh
+    Install_hhvm_CentOS 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
-# Starting DB 
+# Starting DB
 [ -d "/etc/mysql" ] && /bin/mv /etc/mysql{,_bk}
 [ -d "$db_install_dir/support-files" -a -z "`ps -ef | grep -v grep | grep mysql`" ] && /etc/init.d/mysqld start
 
 echo "####################Congratulations########################"
 [ "$Web_yn" == 'y' -a "$Nginx_version" != '4' -a "$Apache_version" == '3' ] && echo -e "\n`printf "%-32s" "Nginx install dir":`${CMSG}$web_install_dir${CEND}"
-[ "$Web_yn" == 'y' -a "$Nginx_version" != '4' -a "$Apache_version" != '3' ] && echo -e "\n`printf "%-32s" "Nginx install dir":`${CMSG}$web_install_dir${CEND}\n`printf "%-32s" "Apache install  dir":`${CMSG}$apache_install_dir${CEND}" 
+[ "$Web_yn" == 'y' -a "$Nginx_version" != '4' -a "$Apache_version" != '3' ] && echo -e "\n`printf "%-32s" "Nginx install dir":`${CMSG}$web_install_dir${CEND}\n`printf "%-32s" "Apache install  dir":`${CMSG}$apache_install_dir${CEND}"
 [ "$Web_yn" == 'y' -a "$Nginx_version" == '4' -a "$Apache_version" != '3' ] && echo -e "\n`printf "%-32s" "Apache install dir":`${CMSG}$apache_install_dir${CEND}"
 [[ "$Tomcat_version" =~ ^[1,2]$ ]] && echo -e "\n`printf "%-32s" "Tomcat install dir":`${CMSG}$tomcat_install_dir${CEND}"
 [ "$DB_yn" == 'y' ] && echo -e "\n`printf "%-32s" "Database install dir:"`${CMSG}$db_install_dir${CEND}"
@@ -651,11 +651,11 @@ echo "####################Congratulations########################"
 [ "$DB_yn" == 'y' ] && echo "`printf "%-32s" "Database user:"`${CMSG}root${CEND}"
 [ "$DB_yn" == 'y' ] && echo "`printf "%-32s" "Database password:"`${CMSG}${dbrootpwd}${CEND}"
 [ "$PHP_yn" == 'y' ] && echo -e "\n`printf "%-32s" "PHP install dir:"`${CMSG}$php_install_dir${CEND}"
-[ "$PHP_cache" == '1' ] && echo "`printf "%-32s" "Opcache Control Panel url:"`${CMSG}http://$IPADDR/ocp.php${CEND}" 
+[ "$PHP_cache" == '1' ] && echo "`printf "%-32s" "Opcache Control Panel url:"`${CMSG}http://$IPADDR/ocp.php${CEND}"
 [ "$PHP_cache" == '2' ] && echo "`printf "%-32s" "xcache Control Panel url:"`${CMSG}http://$IPADDR/xcache${CEND}"
 [ "$PHP_cache" == '2' ] && echo "`printf "%-32s" "xcache user:"`${CMSG}admin${CEND}"
 [ "$PHP_cache" == '2' ] && echo "`printf "%-32s" "xcache password:"`${CMSG}$xcache_admin_pass${CEND}"
-[ "$PHP_cache" == '3' ] && echo "`printf "%-32s" "APC Control Panel url:"`${CMSG}http://$IPADDR/apc.php${CEND}" 
+[ "$PHP_cache" == '3' ] && echo "`printf "%-32s" "APC Control Panel url:"`${CMSG}http://$IPADDR/apc.php${CEND}"
 [ "$PHP_cache" == '4' ] && echo "`printf "%-32s" "eAccelerator Control Panel url:"`${CMSG}http://$IPADDR/control.php${CEND}"
 [ "$PHP_cache" == '4' ] && echo "`printf "%-32s" "eAccelerator user:"`${CMSG}admin${CEND}"
 [ "$PHP_cache" == '4' ] && echo "`printf "%-32s" "eAccelerator password:"`${CMSG}eAccelerator${CEND}"

+ 3 - 3
options.conf

@@ -36,7 +36,7 @@ wwwroot_dir=/data/wwwroot
 wwwlogs_dir=/data/wwwlogs
 
 #########################################################################
-# automatically generated, You can't change 
+# automatically generated, You can't change
 dbrootpwd=
 
 #########################################################################
@@ -55,8 +55,8 @@ backup_content=
 # aliyun OSS Bucket, You can't change
 oss_bucket=
 
-# The backup of the database, You can't change 
+# The backup of the database, You can't change
 db_name=
 
-# The backup of the website, You can't change 
+# The backup of the website, You can't change
 website_name=

+ 16 - 16
pureftpd_vhost.sh

@@ -22,7 +22,7 @@ printf "
 . ./include/color.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
 [ ! -d "$pureftpd_install_dir" ] && { echo "${CFAILURE}The ftp server does not exist! ${CEND}"; exit 1; }
 
@@ -30,7 +30,7 @@ FTP_conf=$pureftpd_install_dir/etc/pure-ftpd.conf
 FTP_tmp_passfile=$pureftpd_install_dir/etc/pureftpd_psss.tmp
 Puredbfile=$pureftpd_install_dir/etc/pureftpd.pdb
 Passwdfile=$pureftpd_install_dir/etc/pureftpd.passwd
-FTP_bin=$pureftpd_install_dir/bin/pure-pw 
+FTP_bin=$pureftpd_install_dir/bin/pure-pw
 [ -z "`grep ^PureDB $FTP_conf`" ] && { echo "${CFAILURE}pure-ftpd is not own password database${CEND}" ; exit 1; }
 
 USER() {
@@ -50,7 +50,7 @@ PASSWORD() {
 while :
 do
     echo
-    read -p "Please input the password: " Password 
+    read -p "Please input the password: " Password
     [ -n "`echo $Password | grep '[+|&]'`" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and &${CEND}"; continue; }
     if (( ${#Password} >= 5 ));then
         echo -e "${Password}\n$Password" > $FTP_tmp_passfile
@@ -65,7 +65,7 @@ DIRECTORY() {
 while :
 do
 echo
-    read -p "Please input the directory(Default directory: $wwwroot_dir): " Directory 
+    read -p "Please input the directory(Default directory: $wwwroot_dir): " Directory
     if [ -z "$Directory" ]; then
         Directory="$wwwroot_dir"
     fi
@@ -89,17 +89,17 @@ What Are You Doing?
 \t${CMSG}6${CEND}. ShowUser
 \t${CMSG}q${CEND}. Exit
 "
-    read -p "Please input the correct option: " Number 
+    read -p "Please input the correct option: " Number
     if [[ ! $Number =~ ^[1-6,q]$ ]];then
-    	echo "${CFAILURE}input error! Please only input 1 ~ 6 and q${CEND}"
+        echo "${CFAILURE}input error! Please only input 1 ~ 6 and q${CEND}"
     else
         case "$Number" in
         1)
             USER
-            [ -e "$Passwdfile" ] && [ -n "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] is already existed! ${CEND}"; continue; } 
+            [ -e "$Passwdfile" ] && [ -n "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] is already existed! ${CEND}"; continue; }
             PASSWORD;DIRECTORY
             $FTP_bin useradd $User -f $Passwdfile -u $run_user -g $run_user -d $Directory -m < $FTP_tmp_passfile
-            $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1 
+            $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1
             echo "#####################################"
             echo
             echo "[$User] create successful! "
@@ -114,8 +114,8 @@ What Are You Doing?
             USER
             [ -e "$Passwdfile" ] && [ -z "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] was not existed! ${CEND}"; continue; }
             DIRECTORY
-            $FTP_bin usermod $User -f $Passwdfile -d $Directory -m 
-            $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1 
+            $FTP_bin usermod $User -f $Passwdfile -d $Directory -m
+            $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1
             echo "#####################################"
             echo
             echo "[$User] modify a successful! "
@@ -130,7 +130,7 @@ What Are You Doing?
             [ -e "$Passwdfile" ] && [ -z "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] was not existed! ${CEND}"; continue; }
             PASSWORD
             $FTP_bin passwd $User -f $Passwdfile -m < $FTP_tmp_passfile
-            $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1 
+            $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1
             echo "#####################################"
             echo
             echo "[$User] Password changed successfully! "
@@ -146,9 +146,9 @@ What Are You Doing?
             else
                 $FTP_bin list
             fi
-            
+
             USER
-            [ -e "$Passwdfile" ] && [ -z "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] was not existed! ${CEND}"; continue; } 
+            [ -e "$Passwdfile" ] && [ -z "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] was not existed! ${CEND}"; continue; }
             $FTP_bin userdel $User -f $Passwdfile -m
             $FTP_bin mkdb $Puredbfile -f $Passwdfile > /dev/null 2>&1
             echo
@@ -157,15 +157,15 @@ What Are You Doing?
 
         5)
             if [ ! -e "$Passwdfile" ];then
-            	echo "${CQUESTION}User was not existed! ${CEND}"
+                echo "${CQUESTION}User was not existed! ${CEND}"
             else
-            	$FTP_bin list
+                $FTP_bin list
             fi
             ;;
 
         6)
             USER
-            [ -e "$Passwdfile" ] && [ -z "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] was not existed! ${CEND}"; continue; } 
+            [ -e "$Passwdfile" ] && [ -z "`grep ^${User}: $Passwdfile`" ] && { echo "${CQUESTION}[$User] was not existed! ${CEND}"; continue; }
             $FTP_bin show $User
             ;;
 

+ 2 - 2
reset_db_root_password.sh

@@ -23,7 +23,7 @@ printf "
 . ./include/check_db.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
 Reset_db_root_password()
 {
@@ -47,7 +47,7 @@ if [ $status_Localhost == '0' -a $status_127 == '0' ]; then
     echo "The new password: ${CMSG}${New_dbrootpwd}${CEND}"
     echo
 else
-	echo "${CFAILURE}Reset Database root password failed! ${CEND}"
+    echo "${CFAILURE}Reset Database root password failed! ${CEND}"
 fi
 }
 Reset_db_root_password

+ 14 - 14
shadowsocks.sh

@@ -3,7 +3,7 @@
 # BLOG:  https://blog.linuxeye.com
 #
 # Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
-#        Install Shadowsocks Server 
+#        Install Shadowsocks Server
 #
 # Project home page:
 #       http://oneinstack.com
@@ -26,7 +26,7 @@ cd src
 . ../include/download.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
 PUBLIC_IPADDR=`../include/get_public_ipaddr.py`
 
@@ -34,7 +34,7 @@ PUBLIC_IPADDR=`../include/get_public_ipaddr.py`
 
 Check_shadowsocks() {
     [ -f /usr/local/bin/ss-server ] && SS_version=1
-    [ -f /usr/bin/ssserver -o -f /usr/local/bin/ssserver ] && SS_version=2 
+    [ -f /usr/bin/ssserver -o -f /usr/local/bin/ssserver ] && SS_version=2
 }
 
 AddUser_shadowsocks() {
@@ -76,13 +76,13 @@ if [ "$OS" == 'CentOS' ];then
     if [ -z "`grep -E $Shadowsocks_port /etc/sysconfig/iptables`" ];then
         iptables -I INPUT 4 -p udp -m state --state NEW -m udp --dport $Shadowsocks_port -j ACCEPT
         iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport $Shadowsocks_port -j ACCEPT
-        service iptables save 
+        service iptables save
     fi
-elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then 
+elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then
     if [ -z "`grep -E $Shadowsocks_port /etc/iptables.up.rules`" ];then
         iptables -I INPUT 4 -p udp -m state --state NEW -m udp --dport $Shadowsocks_port -j ACCEPT
         iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport $Shadowsocks_port -j ACCEPT
-        iptables-save > /etc/iptables.up.rules 
+        iptables-save > /etc/iptables.up.rules
     fi
 else
     echo "${CWARNING}This port is already in iptables${CEND}"
@@ -110,7 +110,7 @@ if [ "$OS" == 'CentOS' ]; then
     do
         yum -y install $Package
     done
-elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then 
+elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then
     SS_version=2
     AddUser_shadowsocks
     Iptables_set
@@ -122,7 +122,7 @@ elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then
 fi
 }
 
-Install_shadowsocks-python() { 
+Install_shadowsocks-python() {
 src_url=http://mirrors.linuxeye.com/oneinstack/src/ez_setup.py && Download_src
 
 which pip > /dev/null 2>&1
@@ -169,7 +169,7 @@ Uninstall_shadowsocks(){
 while :
 do
     echo
-    read -p "Do you want to uninstall Shadowsocks? [y/n]: " Shadowsocks_yn 
+    read -p "Do you want to uninstall Shadowsocks? [y/n]: " Shadowsocks_yn
     if [[ ! $Shadowsocks_yn =~ ^[y,n]$ ]];then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -179,8 +179,8 @@ done
 
 if [ "$Shadowsocks_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 
+    [ "$OS" == 'CentOS' ] && chkconfig --del shadowsocks
+    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && update-rc.d -f shadowsocks remove
     rm -rf /etc/shadowsocks /var/run/shadowsocks.pid /etc/init.d/shadowsocks
     if [ "$SS_version" == '1' ];then
         rm -f /usr/local/bin/ss-local
@@ -236,7 +236,7 @@ EOF
     "local_address":"127.0.0.1",
     "local_port":1080,
     "port_password":{
-	"$Shadowsocks_port":"$Shadowsocks_password"
+    "$Shadowsocks_port":"$Shadowsocks_password"
     },
     "timeout":300,
     "method":"aes-256-cfb",
@@ -247,7 +247,7 @@ EOF
 
 AddUser_Config_shadowsocks(){
 [ ! -e /etc/shadowsocks/config.json ] && { echo "${CFAILURE}Shadowsocks is not installed! ${CEND}"; exit 1; }
-[ -z "`grep \"$Shadowsocks_port\" /etc/shadowsocks/config.json`" ] && sed -i "s@\"port_password\":{@\"port_password\":{\n\t\"$Shadowsocks_port\":\"$Shadowsocks_password\",@" /etc/shadowsocks/config.json || { echo "${CWARNING}This port is already in /etc/shadowsocks/config.json${CEND}"; exit 1; } 
+[ -z "`grep \"$Shadowsocks_port\" /etc/shadowsocks/config.json`" ] && sed -i "s@\"port_password\":{@\"port_password\":{\n\t\"$Shadowsocks_port\":\"$Shadowsocks_password\",@" /etc/shadowsocks/config.json || { echo "${CWARNING}This port is already in /etc/shadowsocks/config.json${CEND}"; exit 1; }
 }
 
 Print_User_shadowsocks(){
@@ -267,7 +267,7 @@ install)
     [ "$SS_version" == '1' ] && Install_shadowsocks-libev
     [ "$SS_version" == '2' ] && Install_shadowsocks-python
     Config_shadowsocks
-    service shadowsocks start 
+    service shadowsocks start
     Print_User_shadowsocks
     ;;
 adduser)

+ 2 - 2
tools/ckssh.py

@@ -7,7 +7,7 @@ sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 sk.settimeout(1)
 try:
     sk.connect((sys.argv[1],int(sys.argv[2])))
-    print 'ok' 
+    print 'ok'
 except Exception:
-    print 'no' 
+    print 'no'
 sk.close()

+ 1 - 1
tools/db_bk.sh

@@ -32,7 +32,7 @@ fi
 if [ -e "$NewFile" ];then
     echo "[$NewFile] The Backup File is exists, Can't Backup" >> $LogFile
 else
-    $db_install_dir/bin/mysqldump -uroot -p$dbrootpwd --databases $DBname > $DumpFile 
+    $db_install_dir/bin/mysqldump -uroot -p$dbrootpwd --databases $DBname > $DumpFile
     cd $backup_dir
     tar czf $NewFile ${DumpFile##*/} >> $LogFile 2>&1
     echo "[$NewFile] Backup success ">> $LogFile

+ 96 - 96
tools/mabs.sh

@@ -6,36 +6,36 @@
 # ignore rule
 ignore_init()
 {
-	# ignore password
-	array_ignore_pwd_length=0
-	if [ -f ./ignore_pwd ]; then
-		while read IGNORE_PWD
-		do
-			array_ignore_pwd[$array_ignore_pwd_length]=$IGNORE_PWD	
-			let array_ignore_pwd_length=$array_ignore_pwd_length+1
-		done < ./ignore_pwd
-	fi
-	
-	# ignore ip address
-	array_ignore_ip_length=0
-	if [ -f ./ignore_ip ]; then
-		while read IGNORE_IP
-		do
-			array_ignore_ip[$array_ignore_ip_length]=$IGNORE_IP
-			let array_ignore_ip_length=$array_ignore_ip_length+1
-		done < ./ignore_ip
-	fi
+    # ignore password
+    array_ignore_pwd_length=0
+    if [ -f ./ignore_pwd ]; then
+        while read IGNORE_PWD
+        do
+            array_ignore_pwd[$array_ignore_pwd_length]=$IGNORE_PWD
+            let array_ignore_pwd_length=$array_ignore_pwd_length+1
+        done < ./ignore_pwd
+    fi
+
+    # ignore ip address
+    array_ignore_ip_length=0
+    if [ -f ./ignore_ip ]; then
+        while read IGNORE_IP
+        do
+            array_ignore_ip[$array_ignore_ip_length]=$IGNORE_IP
+            let array_ignore_ip_length=$array_ignore_ip_length+1
+        done < ./ignore_ip
+    fi
 }
 
 show_version()
 {
-	echo "version: 1.0"
-	echo "updated date: 2014-06-08"
+    echo "version: 1.0"
+    echo "updated date: 2014-06-08"
 }
 
 show_usage()
 {
-	echo -e "`printf %-16s "Usage: $0"` [-h|--help]"
+    echo -e "`printf %-16s "Usage: $0"` [-h|--help]"
         echo -e "`printf %-16s ` [-v|-V|--version]"
         echo -e "`printf %-16s ` [-l|--iplist ... ]"
         echo -e "`printf %-16s ` [-c|--config ... ]"
@@ -61,42 +61,42 @@ eval set -- "$TEMP"
 
 while :
 do
-	[ -z "$1" ] && break;
-	case "$1" in
-		-h|--help) 
-			show_usage; exit 0
-			;;
-		-v|-V|--version)
-			show_version; exit 0
-			;;
-		-l|--iplist)
-			IPLIST=$2; shift 2
-			;;
-		-c|--config)
-			CONFIG_FILE=$2; shift 2
-			;;
-		-t|--sshtimeout)
-			SSHTIMEOUT=$2; shift 2
-			;;
-		-T|--fttimeout)
-			SCPTIMEOUT=$2; shift 2
-			;;
-		-L|--bwlimit)
-			BWLIMIT=$2; shift 2
-			;;
-		--log)
-			LOG_FILE=$2; shift 2
-			;;	
-		-n|--ignore)
-			IGNRFLAG="ignr"; shift
-			;;
-		--)
-			shift
-			;; 
-		*)
-			echo -e "\033[31mERROR: unknown argument! \033[0m\n" && show_usage && exit 1
-			;;
-	esac
+    [ -z "$1" ] && break;
+    case "$1" in
+        -h|--help)
+            show_usage; exit 0
+            ;;
+        -v|-V|--version)
+            show_version; exit 0
+            ;;
+        -l|--iplist)
+            IPLIST=$2; shift 2
+            ;;
+        -c|--config)
+            CONFIG_FILE=$2; shift 2
+            ;;
+        -t|--sshtimeout)
+            SSHTIMEOUT=$2; shift 2
+            ;;
+        -T|--fttimeout)
+            SCPTIMEOUT=$2; shift 2
+            ;;
+        -L|--bwlimit)
+            BWLIMIT=$2; shift 2
+            ;;
+        --log)
+            LOG_FILE=$2; shift 2
+            ;;
+        -n|--ignore)
+            IGNRFLAG="ignr"; shift
+            ;;
+        --)
+            shift
+            ;;
+        *)
+            echo -e "\033[31mERROR: unknown argument! \033[0m\n" && show_usage && exit 1
+            ;;
+    esac
 done
 
 ################  main  #######################
@@ -111,46 +111,46 @@ while [[ $IP_init -le $IP_count ]]
 do
         egrep -v '^#|^$' $IPLIST | sed -n "$IP_init,$(expr $IP_init + 50)p" > $IPLIST.tmp
 
-	IPSEQ=0
+    IPSEQ=0
 
-	while read IP PORT USER PASSWD PASSWD_2ND PASSWD_3RD PASSWD_4TH OTHERS
+    while read IP PORT USER PASSWD PASSWD_2ND PASSWD_3RD PASSWD_4TH OTHERS
        # while read Line
         do
-		[ -z "`echo $IP | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|CNS'`" ] && continue
-	        if [ "`python ./ckssh.py $IP $PORT`" == 'no' ];then
-			[ ! -e ipnologin.txt ] && > ipnologin.txt
-			[ -z "`grep $IP ipnologin.txt | grep $(date +%F)`" ] && echo "`date +%F_%H%M` $IP" >> ipnologin.txt
-			continue
-	        fi
-		
-		#[ -e "~/.ssh/known_hosts" ] && grep $IP ~/.ssh/known_hosts | sed -i "/$IP/d" ~/.ssh/known_hosts
-
-		let IPSEQ=$IPSEQ+1
-
-	        if [ $IGNRFLAG == "ignr" ]; then
-	                ignore_init
-	                ignored_flag=0
-
-	                i=0
-	                while [ $i -lt $array_ignore_pwd_length ]
-	                do
-	                        [ ${PASSWD}x == ${array_ignore_pwd[$i]}x ] && ignored_flag=1 && break
-	                        let i=$i+1
-	                done
-
-	                [ $ignored_flag -eq 1 ] && continue
-
-	                j=0
-	                while [ $j -lt $array_ignore_ip_length ]
-	                do
-	                        [ ${IP}x == ${array_ignore_ip[$j]}x ] && ignored_flag=1 && break
-	                        let j=$j+1
-	                done
-
-	                [ $ignored_flag -eq 1 ] && continue
-	        fi
-
-		PASSWD_USE=$PASSWD
+        [ -z "`echo $IP | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|CNS'`" ] && continue
+            if [ "`python ./ckssh.py $IP $PORT`" == 'no' ];then
+            [ ! -e ipnologin.txt ] && > ipnologin.txt
+            [ -z "`grep $IP ipnologin.txt | grep $(date +%F)`" ] && echo "`date +%F_%H%M` $IP" >> ipnologin.txt
+            continue
+            fi
+
+        #[ -e "~/.ssh/known_hosts" ] && grep $IP ~/.ssh/known_hosts | sed -i "/$IP/d" ~/.ssh/known_hosts
+
+        let IPSEQ=$IPSEQ+1
+
+            if [ $IGNRFLAG == "ignr" ]; then
+                    ignore_init
+                    ignored_flag=0
+
+                    i=0
+                    while [ $i -lt $array_ignore_pwd_length ]
+                    do
+                            [ ${PASSWD}x == ${array_ignore_pwd[$i]}x ] && ignored_flag=1 && break
+                            let i=$i+1
+                    done
+
+                    [ $ignored_flag -eq 1 ] && continue
+
+                    j=0
+                    while [ $j -lt $array_ignore_ip_length ]
+                    do
+                            [ ${IP}x == ${array_ignore_ip[$j]}x ] && ignored_flag=1 && break
+                            let j=$j+1
+                    done
+
+                    [ $ignored_flag -eq 1 ] && continue
+            fi
+
+        PASSWD_USE=$PASSWD
 
                 IPcode=$(echo "ibase=16;$(echo "$IP" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
                 Portcode=$(echo "ibase=16;$(echo "$PORT" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
@@ -158,7 +158,7 @@ do
                 PWcode=$(echo "ibase=16;$(echo "$PASSWD_USE" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
                 Othercode=$(echo "ibase=16;$(echo "$OTHERS" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
                 #echo $IPcode $Portcode $USER $PWcode $CONFIG_FILE $SSHTIMEOUT $SCPTIMEOUT $BWLIMIT $Othercode
-		./thread.sh $IPcode $Portcode $USER $PWcode $CONFIG_FILE $SSHTIMEOUT $SCPTIMEOUT $BWLIMIT $Othercode | tee logs/$IP.log &
+        ./thread.sh $IPcode $Portcode $USER $PWcode $CONFIG_FILE $SSHTIMEOUT $SCPTIMEOUT $BWLIMIT $Othercode | tee logs/$IP.log &
         done < $IPLIST.tmp
         sleep 3
         IP_init=$(expr $IP_init + 50)

+ 111 - 111
tools/mscp.exp

@@ -1,23 +1,23 @@
-#!/usr/bin/expect -- 
+#!/usr/bin/expect --
 
 proc Usage_Exit {self} {
-	puts ""
-	puts "Usage: $self ip user passwd port sourcefile destdir direction bwlimit timeout"
-	puts ""
-	puts "       sourcefile: a file or directory to be transferred"
-	puts "                   需要拷贝目录时目录名后不要带 /, 否则会拷贝该目录下的所有文件"
-	puts "       destdir:    the location that the sourcefile to be put into"
-	puts "       direction:  pull or push"
-	puts "                   pull: remote -> local"
-	puts "                   push: local -> remote"
-	puts "       bwlimit:    bandwidth limit, kbit/s, 0 means no limit" 
-	puts "       timeout:    timeout of expect, s, -1 means no timeout"
-	puts ""
-	exit 1
+    puts ""
+    puts "Usage: $self ip user passwd port sourcefile destdir direction bwlimit timeout"
+    puts ""
+    puts "       sourcefile: a file or directory to be transferred"
+    puts "                   需要拷贝目录时目录名后不要带 /, 否则会拷贝该目录下的所有文件"
+    puts "       destdir:    the location that the sourcefile to be put into"
+    puts "       direction:  pull or push"
+    puts "                   pull: remote -> local"
+    puts "                   push: local -> remote"
+    puts "       bwlimit:    bandwidth limit, kbit/s, 0 means no limit"
+    puts "       timeout:    timeout of expect, s, -1 means no timeout"
+    puts ""
+    exit 1
 }
 
 if { [llength $argv] < 9 } {
-	Usage_Exit $argv0
+    Usage_Exit $argv0
 }
 
 set ipcode [lindex $argv 0]
@@ -41,118 +41,118 @@ for {} {1} {} {
 
 if { $direction == "pull" } {
 
-	if { $bwlimit > 0 } {
-		spawn rsync -crazP --delete --bwlimit=$bwlimit -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $ip:$sourcefile $destdir
-	} elseif { $bwlimit == 0 } {
-		spawn rsync -crazP --delete -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $ip:$sourcefile $destdir
-	} else {
-		Usage_Exit $argv0
-	}
+    if { $bwlimit > 0 } {
+        spawn rsync -crazP --delete --bwlimit=$bwlimit -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $ip:$sourcefile $destdir
+    } elseif { $bwlimit == 0 } {
+        spawn rsync -crazP --delete -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $ip:$sourcefile $destdir
+    } else {
+        Usage_Exit $argv0
+    }
 
 } elseif { $direction == "push" } {
 
-	if { $bwlimit > 0 } {
-		spawn rsync -crazP --delete --bwlimit=$bwlimit -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $sourcefile $ip:$destdir
-	} elseif { $bwlimit == 0 } {
-		spawn rsync -crazP --delete -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $sourcefile $ip:$destdir
-	} else {
-		Usage_Exit $argv0
-	}
+    if { $bwlimit > 0 } {
+        spawn rsync -crazP --delete --bwlimit=$bwlimit -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $sourcefile $ip:$destdir
+    } elseif { $bwlimit == 0 } {
+        spawn rsync -crazP --delete -e "/usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port" $sourcefile $ip:$destdir
+    } else {
+        Usage_Exit $argv0
+    }
 
 } else {
-	Usage_Exit $argv0
+    Usage_Exit $argv0
 }
 
-expect 	{
-
-	"assword:" {
-		send "$passwd\r" 
-		break;
-	}
-	
-	"yes/no)?" {
-		set yesnoflag 1
-		send "yes\r"
-		break;
-	}
-	
-	"FATAL" {
-		puts "\nCONNECTERROR: $ip occur FATAL ERROR!!!\n"
-		exit 1
-	}
-	
-	timeout {
-		puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
-		exit 1
-	}
-	
-	"No route to host" {
-		puts "\nCONNECTERROR: $ip No route to host!!!\n"
-		exit 1
-	}
-	
-	"Connection Refused" {
-		puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
-		exit 1
-	}
-
-	"Connection refused" {
-		puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
-		exit 1
-	}
-
-	"Host key verification failed" {
-		puts "\nCONNECTERROR: $ip Host key verification failed!!!\n"
-		exit 1
-	}
-	
-	"Illegal host key" {
-		puts "\nCONNECTERROR: $ip Illegal host key!!!\n"
-		exit 1
-	}
-		
-	"Connection Timed Out" {
-		puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
-		exit 1
-	}
-
-	"Interrupted system call" {
-		puts "\n$ip Interrupted system call!!!\n"
-	}
+expect  {
+
+    "assword:" {
+        send "$passwd\r"
+        break;
+    }
+
+    "yes/no)?" {
+        set yesnoflag 1
+        send "yes\r"
+        break;
+    }
+
+    "FATAL" {
+        puts "\nCONNECTERROR: $ip occur FATAL ERROR!!!\n"
+        exit 1
+    }
+
+    timeout {
+        puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
+        exit 1
+    }
+
+    "No route to host" {
+        puts "\nCONNECTERROR: $ip No route to host!!!\n"
+        exit 1
+    }
+
+    "Connection Refused" {
+        puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
+        exit 1
+    }
+
+    "Connection refused" {
+        puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
+        exit 1
+    }
+
+    "Host key verification failed" {
+        puts "\nCONNECTERROR: $ip Host key verification failed!!!\n"
+        exit 1
+    }
+
+    "Illegal host key" {
+        puts "\nCONNECTERROR: $ip Illegal host key!!!\n"
+        exit 1
+    }
+
+    "Connection Timed Out" {
+        puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
+        exit 1
+    }
+
+    "Interrupted system call" {
+        puts "\n$ip Interrupted system call!!!\n"
+    }
 }
 
 }
 
 if { $yesnoflag == 1 } {
-	expect {
-		"assword:" {
-			send "$passwd\r"
-		}
-
-		"yes/no)?" {
-			set yesnoflag 2
-			send "yes\r"
-		}
-	}
+    expect {
+        "assword:" {
+            send "$passwd\r"
+        }
+
+        "yes/no)?" {
+            set yesnoflag 2
+            send "yes\r"
+        }
+    }
 }
 
 if { $yesnoflag == 2 } {
-	expect {
-		"assword:" {
-			send "$passwd\r"
-		}
-	}
+    expect {
+        "assword:" {
+            send "$passwd\r"
+        }
+    }
 }
 
 expect {
-	"assword:" {
-		send "$passwd\r"
-		puts "\nPASSWORDERROR: $ip Password error!!!\n"
-		exit 1
-	}
-	
-	eof { 
-		puts "OK_SCP: $ip\n"
-		exit 0;
-	}
+    "assword:" {
+        send "$passwd\r"
+        puts "\nPASSWORDERROR: $ip Password error!!!\n"
+        exit 1
+    }
+
+    eof {
+        puts "OK_SCP: $ip\n"
+        exit 0;
+    }
 }

+ 83 - 83
tools/mssh.exp

@@ -1,8 +1,8 @@
 #!/usr/bin/expect --
 
 if { [llength $argv] < 4 } {
-	puts "Usage: $argv0 ip user passwd port commands timeout"
-	exit 1
+    puts "Usage: $argv0 ip user passwd port commands timeout"
+    exit 1
 }
 
 match_max 600000
@@ -26,104 +26,104 @@ for {} {1} {} {
 
 spawn /usr/bin/ssh -o GSSAPIAuthentication=no -q -l$user -p$port $ip
 
-expect 	{
-
-	"assword:" {
-		send "$passwd\r"
-		break;
-	}
-
-	"yes/no)?" {
-		set yesnoflag 1
-		send "yes\r"
-		break;
-	}
-
-	"FATAL" {
-		puts "\nCONNECTERROR: $ip occur FATAL ERROR!!!\n"
-		exit 1
-	}
-
-	timeout {
-		puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
-		exit 1
-	}
-
-	"No route to host" {
-		puts "\nCONNECTERROR: $ip No route to host!!!\n"
-		exit 1
-	}
-
-	"Connection Refused" {
-		puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
-		exit 1
-	}
-
-	"Connection refused" {
-		puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
-		exit 1
-	}
-
-	"Host key verification failed" {
-		puts "\nCONNECTERROR: $ip Host key verification failed!!!\n"
-		exit 1
-	}
-
-	"Illegal host key" {
-		puts "\nCONNECTERROR: $ip Illegal host key!!!\n"
-		exit 1
-	}
-		
-	"Connection Timed Out" {
-		puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
-		exit 1
-	}
-
-	"Interrupted system call" {
-		puts "\n$ip Interrupted system call!!!\n"
-	}
+expect  {
+
+    "assword:" {
+        send "$passwd\r"
+        break;
+    }
+
+    "yes/no)?" {
+        set yesnoflag 1
+        send "yes\r"
+        break;
+    }
+
+    "FATAL" {
+        puts "\nCONNECTERROR: $ip occur FATAL ERROR!!!\n"
+        exit 1
+    }
+
+    timeout {
+        puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
+        exit 1
+    }
+
+    "No route to host" {
+        puts "\nCONNECTERROR: $ip No route to host!!!\n"
+        exit 1
+    }
+
+    "Connection Refused" {
+        puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
+        exit 1
+    }
+
+    "Connection refused" {
+        puts "\nCONNECTERROR: $ip Connection Refused!!!\n"
+        exit 1
+    }
+
+    "Host key verification failed" {
+        puts "\nCONNECTERROR: $ip Host key verification failed!!!\n"
+        exit 1
+    }
+
+    "Illegal host key" {
+        puts "\nCONNECTERROR: $ip Illegal host key!!!\n"
+        exit 1
+    }
+
+    "Connection Timed Out" {
+        puts "\nCONNECTERROR: $ip Logon timeout!!!\n"
+        exit 1
+    }
+
+    "Interrupted system call" {
+        puts "\n$ip Interrupted system call!!!\n"
+    }
 }
 }
 
 if { $yesnoflag == 1 } {
-	expect {
-		"assword:" {
-			send "$passwd\r"
-		}
-
-		"yes/no)?" {
-			set yesnoflag 2
-			send "yes\r"
-		}
-	}
+    expect {
+        "assword:" {
+            send "$passwd\r"
+        }
+
+        "yes/no)?" {
+            set yesnoflag 2
+            send "yes\r"
+        }
+    }
 }
 
 if { $yesnoflag == 2 } {
-	expect {
-		"assword:" {
-			send "$passwd\r"
-		}
-	}
+    expect {
+        "assword:" {
+            send "$passwd\r"
+        }
+    }
 }
 
 expect {
-	"@" {send "$commands \r"}
-	"assword:" {
-		send "$passwd\r"
-		puts "\nPASSWORDERROR: $ip Password error!!!\n"
-		exit 1
-	}
+    "@" {send "$commands \r"}
+    "assword:" {
+        send "$passwd\r"
+        puts "\nPASSWORDERROR: $ip Password error!!!\n"
+        exit 1
+    }
 }
 
 expect {
-	"@" {send "sleep 1\r"}
+    "@" {send "sleep 1\r"}
 }
 
 expect {
-	"@" {send "exit\r"}
+    "@" {send "exit\r"}
 }
 
 expect eof {
-	puts "OK_SSH: $ip\n"
-	exit 0;
+    puts "OK_SSH: $ip\n"
+    exit 0;
 }

+ 24 - 24
tools/thread.sh

@@ -16,30 +16,30 @@ BWLIMIT=$8
 
 while read eachline
 do
-	[ -z "`echo $eachline | grep -E '^com|^file'`" ] && continue
-
-	myKEYWORD=`echo $eachline | awk -F"$myIFS" '{ print $1 }'`
-	myCONFIGLINE=`echo $eachline | awk -F"$myIFS" '{ print $2 }'`
-
-	if [ "$myKEYWORD"x == "file"x ]; then
-		SOURCEFILE=`echo $myCONFIGLINE | awk '{ print $1 }'`
-		DESTDIR=`echo $myCONFIGLINE | awk '{ print $2 }'`
-		DIRECTION=`echo $myCONFIGLINE | awk '{ print $3 }'`
-		./mscp.exp $IP $USER $PASSWD $PORT $SOURCEFILE $DESTDIR $DIRECTION $BWLIMIT $SCPTIMEOUT
-		
-		[ $? -ne 0 ] && echo -e "\033[31mSCP Try Out All Password Failed\033[0m\n"
-
-	elif [ "$myKEYWORD"x == "com"x ]; then
-		./mssh.exp $IP $USER $PASSWD $PORT "${myCONFIGLINE}" $SSHTIMEOUT
-		[ $? -ne 0 ] && echo -e "\033[31mSSH Try Out All Password Failed\033[0m\n"
-
-	else
-		echo "ERROR: configuration wrong! [$eachline] "
-		echo "       where KEYWORD should not be [$myKEYWORD], but 'com' or 'file'"
-		echo "       if you dont want to run it, you can comment it with '#'"
-		echo ""
-		exit
-	fi
+    [ -z "`echo $eachline | grep -E '^com|^file'`" ] && continue
+
+    myKEYWORD=`echo $eachline | awk -F"$myIFS" '{ print $1 }'`
+    myCONFIGLINE=`echo $eachline | awk -F"$myIFS" '{ print $2 }'`
+
+    if [ "$myKEYWORD"x == "file"x ]; then
+        SOURCEFILE=`echo $myCONFIGLINE | awk '{ print $1 }'`
+        DESTDIR=`echo $myCONFIGLINE | awk '{ print $2 }'`
+        DIRECTION=`echo $myCONFIGLINE | awk '{ print $3 }'`
+        ./mscp.exp $IP $USER $PASSWD $PORT $SOURCEFILE $DESTDIR $DIRECTION $BWLIMIT $SCPTIMEOUT
+
+        [ $? -ne 0 ] && echo -e "\033[31mSCP Try Out All Password Failed\033[0m\n"
+
+    elif [ "$myKEYWORD"x == "com"x ]; then
+        ./mssh.exp $IP $USER $PASSWD $PORT "${myCONFIGLINE}" $SSHTIMEOUT
+        [ $? -ne 0 ] && echo -e "\033[31mSSH Try Out All Password Failed\033[0m\n"
+
+    else
+        echo "ERROR: configuration wrong! [$eachline] "
+        echo "       where KEYWORD should not be [$myKEYWORD], but 'com' or 'file'"
+        echo "       if you dont want to run it, you can comment it with '#'"
+        echo ""
+        exit
+    fi
 
 done < $CONFIG_FILE
 

+ 1 - 1
tools/website_bk.sh

@@ -24,7 +24,7 @@ if [ `du -sm "$wwwroot_dir/$WebSite" | awk '{print $1}'` -lt 1024 ];then
     else
         echo "[$OldFile] Delete Old Backup File" >> $LogFile
     fi
-    
+
     if [ -e "$NewFile" ];then
         echo "[$NewFile] The Backup File is exists, Can't Backup" >> $LogFile
     else

+ 21 - 21
uninstall.sh

@@ -24,20 +24,20 @@ printf "
 . ./include/check_db.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
 
 Usage(){
 printf "
 Usage: $0 [  ${CMSG}all${CEND} | ${CMSG}web${CEND} | ${CMSG}db${CEND} | ${CMSG}php${CEND} | ${CMSG}hhvm${CEND} | ${CMSG}pureftpd${CEND} | ${CMSG}redis${CEND} | ${CMSG}memcached${CEND} ]
-${CMSG}all${CEND}            --->Uninstall All 
+${CMSG}all${CEND}            --->Uninstall All
 ${CMSG}web${CEND}            --->Uninstall Nginx/Tengine/Apache/Tomcat
 ${CMSG}db${CEND}             --->Uninstall MySQL/MariaDB/Percona
 ${CMSG}php${CEND}            --->Uninstall PHP
-${CMSG}hhvm${CEND}           --->Uninstall HHVM 
-${CMSG}pureftpd${CEND}       --->Uninstall PureFtpd 
+${CMSG}hhvm${CEND}           --->Uninstall HHVM
+${CMSG}pureftpd${CEND}       --->Uninstall PureFtpd
 ${CMSG}redis${CEND}          --->Uninstall Redis
-${CMSG}memcached${CEND}      --->Uninstall Memcached 
+${CMSG}memcached${CEND}      --->Uninstall Memcached
 
 "
 }
@@ -60,7 +60,7 @@ echo "${CWARNING}You will uninstall OneinStack, Please backup your configure fil
 }
 
 Print_web() {
-[ -d "$nginx_install_dir" ] && echo "$nginx_install_dir" 
+[ -d "$nginx_install_dir" ] && echo "$nginx_install_dir"
 [ -d "$tengine_install_dir" ] && echo "$tengine_install_dir"
 [ -d "$openresty_install_dir" ] && echo "$openresty_install_dir"
 [ -e "/etc/init.d/nginx" ] && echo '/etc/init.d/nginx'
@@ -115,8 +115,8 @@ Print_PHP() {
 Uninstall_PHP() {
 [ -e "$php_install_dir/bin/phpize" -a -e "$php_install_dir/etc/php-fpm.conf" ] && { service php-fpm stop > /dev/null 2>&1; rm -rf $php_install_dir /etc/init.d/php-fpm; }
 [ -e "$php_install_dir/bin/phpize" -a ! -e "$php_install_dir/etc/php-fpm.conf" ] && rm -rf $php_install_dir
-[ -e "/usr/local/imagemagick" ] && rm -rf /usr/local/imagemagick 
-[ -e "/usr/local/graphicsmagick" ] && rm -rf /usr/local/graphicsmagick 
+[ -e "/usr/local/imagemagick" ] && rm -rf /usr/local/imagemagick
+[ -e "/usr/local/graphicsmagick" ] && rm -rf /usr/local/graphicsmagick
 sed -i "s@$php_install_dir/bin:@@" /etc/profile
 echo "${CMSG}PHP uninstall completed${CEND}"
 }
@@ -137,7 +137,7 @@ echo "${CMSG}HHVM uninstall completed${CEND}"
 
 Print_PureFtpd() {
 [ -e "$pureftpd_install_dir" ] && echo "$pureftpd_install_dir"
-[ -e "/etc/init.d/pureftpd" ] && echo "/etc/init.d/pureftpd" 
+[ -e "/etc/init.d/pureftpd" ] && echo "/etc/init.d/pureftpd"
 }
 
 Uninstall_PureFtpd() {
@@ -174,14 +174,14 @@ while :
 do
     printf "
 What Are You Doing?
-\t${CMSG}0${CEND}. Uninstall All 
-\t${CMSG}1${CEND}. Uninstall Nginx/Tengine/Apache/Tomcat 
-\t${CMSG}2${CEND}. Uninstall MySQL/MariaDB/Percona 
-\t${CMSG}3${CEND}. Uninstall PHP 
-\t${CMSG}4${CEND}. Uninstall HHVM 
-\t${CMSG}5${CEND}. Uninstall PureFtpd 
-\t${CMSG}6${CEND}. Uninstall Redis 
-\t${CMSG}7${CEND}. Uninstall Memcached 
+\t${CMSG}0${CEND}. Uninstall All
+\t${CMSG}1${CEND}. Uninstall Nginx/Tengine/Apache/Tomcat
+\t${CMSG}2${CEND}. Uninstall MySQL/MariaDB/Percona
+\t${CMSG}3${CEND}. Uninstall PHP
+\t${CMSG}4${CEND}. Uninstall HHVM
+\t${CMSG}5${CEND}. Uninstall PureFtpd
+\t${CMSG}6${CEND}. Uninstall Redis
+\t${CMSG}7${CEND}. Uninstall Memcached
 \t${CMSG}q${CEND}. Exit
 "
     echo
@@ -305,22 +305,22 @@ elif [ $# == 1 ];then
     hhvm)
         Print_HHVM
         Uninstall_status
-        [ "$uninstall_yn" == 'y' ] && Uninstall_HHVM || exit 
+        [ "$uninstall_yn" == 'y' ] && Uninstall_HHVM || exit
         ;;
     pureftpd)
         Print_PureFtpd
         Uninstall_status
-        [ "$uninstall_yn" == 'y' ] && Uninstall_PureFtpd || exit 
+        [ "$uninstall_yn" == 'y' ] && Uninstall_PureFtpd || exit
         ;;
     redis)
         Print_Redis
         Uninstall_status
-        [ "$uninstall_yn" == 'y' ] && Uninstall_Redis || exit 
+        [ "$uninstall_yn" == 'y' ] && Uninstall_Redis || exit
         ;;
     memcached)
         Print_Memcached
         Uninstall_status
-        [ "$uninstall_yn" == 'y' ] && Uninstall_Memcached || exit 
+        [ "$uninstall_yn" == 'y' ] && Uninstall_Memcached || exit
         ;;
     *)
         Usage

+ 8 - 8
upgrade.sh

@@ -13,7 +13,7 @@ clear
 printf "
 #######################################################################
 #       OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+      #
-#       upgrade Web,Database,PHP,Redis,phpMyAdmin for OneinStack      # 
+#       upgrade Web,Database,PHP,Redis,phpMyAdmin for OneinStack      #
 #       For more information please visit http://oneinstack.com       #
 #######################################################################
 "
@@ -34,9 +34,9 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 . ./include/upgrade_phpmyadmin.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
-# get the IP information 
+# get the IP information
 PUBLIC_IPADDR=`./include/get_public_ipaddr.py`
 [ "`./include/get_ipaddr_state.py $PUBLIC_IPADDR`" == '\u4e2d\u56fd' ] && IPADDR_STATE=CN
 
@@ -116,23 +116,23 @@ elif [ $# == 1 ];then
             Upgrade_OpenResty
         fi
         ;;
-    
+
     db)
         Upgrade_DB
         ;;
-    
+
     php)
         Upgrade_PHP
         ;;
-    
+
     redis)
         Upgrade_Redis
         ;;
-    
+
     phpmyadmin)
         Upgrade_phpMyAdmin
         ;;
-    
+
     *)
         Usage
         ;;

+ 20 - 20
vhost.sh

@@ -23,7 +23,7 @@ printf "
 . ./include/get_char.sh
 
 # Check if user is root
-[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; } 
+[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
 
 Usage() {
 printf "
@@ -255,7 +255,7 @@ if [ "$moredomainame_yn" == 'y' ]; then
                 break
             fi
         done
-        [ "$nginx_ssl_yn" == 'y' ] && HTTP_flag=https || HTTP_flag=http 
+        [ "$nginx_ssl_yn" == 'y' ] && HTTP_flag=https || HTTP_flag=http
         [ "$redirect_yn" == 'y' ] && Nginx_redirect=$(echo -e "if (\$host != $domain) {\n    rewrite ^/(.*)\$ \$scheme://$domain/\$1 permanent;\n    }")
     fi
 fi
@@ -298,7 +298,7 @@ Nginx_anti_hotlinking() {
 while :
 do
     echo
-    read -p "Do you want to add hotlink protection? [y/n]: " anti_hotlinking_yn 
+    read -p "Do you want to add hotlink protection? [y/n]: " anti_hotlinking_yn
     if [[ ! $anti_hotlinking_yn =~ ^[y,n]$ ]];then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -312,7 +312,7 @@ else
     domain_allow="*.$domain $domain"
 fi
 
-if [ "$anti_hotlinking_yn" == 'y' ];then 
+if [ "$anti_hotlinking_yn" == 'y' ];then
     if [ "$moredomainame_yn" == 'y' ]; then
         domain_allow_all=$domain_allow$moredomainame
     else
@@ -333,7 +333,7 @@ do
     if [[ ! $rewrite_yn =~ ^[y,n]$ ]];then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-        break 
+        break
     fi
 done
 if [ "$rewrite_yn" == 'n' ];then
@@ -345,14 +345,14 @@ else
     echo "${CMSG}wordpress${CEND},${CMSG}discuz${CEND},${CMSG}opencart${CEND},${CMSG}thinkphp${CEND},${CMSG}laravel${CEND},${CMSG}typecho${CEND},${CMSG}ecshop${CEND},${CMSG}drupal${CEND},${CMSG}joomla${CEND} rewrite was exist."
     read -p "(Default rewrite: other):" rewrite
     if [ "$rewrite" == "" ]; then
-    	rewrite="other"
+        rewrite="other"
     fi
     echo "You choose rewrite=${CMSG}$rewrite${CEND}"
     [ "$NGX_FLAG" == 'php' -a "$rewrite" == "thinkphp" ] && NGX_CONF=$(echo -e "location ~ \.php {\n    #fastcgi_pass remote_php_ip:9000;\n    fastcgi_pass unix:/dev/shm/php-cgi.sock;\n    fastcgi_index index.php;\n    include fastcgi_params;\n    set \$real_script_name \$fastcgi_script_name;\n        if (\$fastcgi_script_name ~ \"^(.+?\.php)(/.+)\$\") {\n        set \$real_script_name \$1;\n        #set \$path_info \$2;\n        }\n    fastcgi_param SCRIPT_FILENAME \$document_root\$real_script_name;\n    fastcgi_param SCRIPT_NAME \$real_script_name;\n    #fastcgi_param PATH_INFO \$path_info;\n    }")
     if [ -e "config/$rewrite.conf" ];then
-    	/bin/cp config/$rewrite.conf $web_install_dir/conf/rewrite/$rewrite.conf
+        /bin/cp config/$rewrite.conf $web_install_dir/conf/rewrite/$rewrite.conf
     else
-    	touch "$web_install_dir/conf/rewrite/$rewrite.conf"
+        touch "$web_install_dir/conf/rewrite/$rewrite.conf"
     fi
 fi
 }
@@ -361,11 +361,11 @@ Nginx_log() {
 while :
 do
     echo
-    read -p "Allow Nginx/Tengine/OpenResty access_log? [y/n]: " access_yn 
+    read -p "Allow Nginx/Tengine/OpenResty access_log? [y/n]: " access_yn
     if [[ ! $access_yn =~ ^[y,n]$ ]];then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
-        break 
+        break
     fi
 done
 if [ "$access_yn" == 'n' ]; then
@@ -506,7 +506,7 @@ printf "
 echo "`printf "%-30s" "Your domain:"`${CMSG}$domain${CEND}"
 echo "`printf "%-30s" "Virtualhost conf:"`${CMSG}$web_install_dir/conf/vhost/$domain.conf${CEND}"
 echo "`printf "%-30s" "Directory of:"`${CMSG}$vhostdir${CEND}"
-[ "$rewrite_yn" == 'y' ] && echo "`printf "%-30s" "Rewrite rule:"`${CMSG}$web_install_dir/conf/rewrite/$rewrite.conf${CEND}" 
+[ "$rewrite_yn" == 'y' ] && echo "`printf "%-30s" "Rewrite rule:"`${CMSG}$web_install_dir/conf/rewrite/$rewrite.conf${CEND}"
 [ "$nginx_ssl_yn" == 'y' ] && Print_ssl
 }
 
@@ -535,7 +535,7 @@ Create_apache_conf() {
 [ ! -d $apache_install_dir/conf/vhost ] && mkdir $apache_install_dir/conf/vhost
 cat > $apache_install_dir/conf/vhost/$domain.conf << EOF
 <VirtualHost *:80>
-    ServerAdmin admin@linuxeye.com 
+    ServerAdmin admin@linuxeye.com
     DocumentRoot "$vhostdir"
     ServerName $domain
     $Apache_Domain_alias
@@ -663,7 +663,7 @@ echo "`printf "%-30s" "Your domain:"`${CMSG}$domain${CEND}"
 echo "`printf "%-30s" "Nginx Virtualhost conf:"`${CMSG}$web_install_dir/conf/vhost/$domain.conf${CEND}"
 echo "`printf "%-30s" "Apache Virtualhost conf:"`${CMSG}$apache_install_dir/conf/vhost/$domain.conf${CEND}"
 echo "`printf "%-30s" "Directory of:"`${CMSG}$vhostdir${CEND}"
-[ "$rewrite_yn" == 'y' ] && echo "`printf "%-28s" "Rewrite rule:"`${CMSG}$web_install_dir/conf/rewrite/$rewrite.conf${CEND}" 
+[ "$rewrite_yn" == 'y' ] && echo "`printf "%-28s" "Rewrite rule:"`${CMSG}$web_install_dir/conf/rewrite/$rewrite.conf${CEND}"
 [ "$nginx_ssl_yn" == 'y' ] && Print_ssl
 }
 
@@ -715,7 +715,7 @@ Del_NGX_Vhost() {
         if [ -n "$Domain_List" ];then
             echo
             echo "Virtualhost list:"
-	    echo ${CMSG}$Domain_List${CEND}
+        echo ${CMSG}$Domain_List${CEND}
             while :
             do
                 echo
@@ -730,7 +730,7 @@ Del_NGX_Vhost() {
                         while :
                         do
                             echo
-                            read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_yn 
+                            read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_yn
                             if [[ ! $Del_Vhost_wwwroot_yn =~ ^[y,n]$ ]];then
                                 echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                             else
@@ -759,7 +759,7 @@ Del_NGX_Vhost() {
 Del_Apache_Vhost() {
     if [ -e "$apache_install_dir/conf/httpd.conf" ];then
         if [ -e "$web_install_dir/sbin/nginx" ];then
-            rm -rf $apache_install_dir/conf/vhost/${domain}.conf 
+            rm -rf $apache_install_dir/conf/vhost/${domain}.conf
             /etc/init.d/httpd restart
         else
             Domain_List=`ls $apache_install_dir/conf/vhost | grep -v '0.conf' | sed "s@.conf@@g"`
@@ -813,7 +813,7 @@ Del_Tomcat_Vhost() {
     if [ -e "$tomcat_install_dir/conf/server.xml" ];then
         if [ -e "$web_install_dir/sbin/nginx" ];then
             if [ -n "`grep vhost-${domain} $tomcat_install_dir/conf/server.xml`" ];then
-                sed -i /vhost-${domain}/d $tomcat_install_dir/conf/server.xml 
+                sed -i /vhost-${domain}/d $tomcat_install_dir/conf/server.xml
                 rm -rf $tomcat_install_dir/conf/vhost/${domain}.xml
                 /etc/init.d/tomcat restart
             fi
@@ -844,7 +844,7 @@ Del_Tomcat_Vhost() {
                                     break
                                 fi
                             done
-    
+
                             if [ "$Del_Vhost_wwwroot_yn" == 'y' ];then
                                 echo "Press Ctrl+c to cancel or Press any key to continue..."
                                 char=`get_char`
@@ -857,7 +857,7 @@ Del_Tomcat_Vhost() {
                         break
                     fi
                 done
-    
+
             else
                 echo "${CWARNING}Virtualhost was not exist! ${CEND}"
             fi
@@ -866,7 +866,7 @@ Del_Tomcat_Vhost() {
 }
 
 if [ $# == 0 ];then
-    Add_Vhost 
+    Add_Vhost
 elif [ $# == 1 ];then
     case $1 in
     add)