Browse Source

Fixed bad function name

lj2007331@gmail.com 6 years ago
parent
commit
84edc34c0d

+ 11 - 15
README.md

@@ -25,50 +25,46 @@ Script properties:
 
 If your server system: CentOS/Redhat (Do not enter "//" and "// subsequent sentence)
 ```bash
-yum -y install wget screen python   // for CentOS / Redhat
+yum -y install wget screen   // for CentOS / Redhat
 wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz   // Contains the source code
 tar xzf oneinstack-full.tar.gz
 cd oneinstack   // If you need to modify the directory (installation, data storage, Nginx logs), modify options.conf file
 screen -S oneinstack    // If network interruption, you can execute the command `screen -r oneinstack` reconnect install window
-./install.sh   // Do not sh install.sh or bash install.sh such execution
+./install.sh
 ```
 If your server system: Debian/Ubuntu (Do not enter "//" and "// subsequent sentence)
 ```bash
-apt-get -y install wget screen python    // for Debian / Ubuntu
+apt-get -y install wget screen   // for Debian / Ubuntu
 wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz   // Contains the source code
 tar xzf oneinstack-full.tar.gz
 cd oneinstack    // If you need to modify the directory (installation, data storage, Nginx logs), modify options.conf file
 screen -S oneinstack    // If network interruption, you can execute the command `screen -r oneinstack` reconnect install window
-./install.sh   // Do not sh install.sh or bash install.sh such execution
+./install.sh
 ```
 
 ## How to add Extensions
 
 ```bash
-cd ~/oneinstack    // Must enter the directory execution under oneinstack
-./addons.sh    // Do not sh addons.sh or bash addons.sh such execution
+~/oneinstack/addons.sh
 
 ```
 
 ## How to add a virtual host
 
 ```bash
-cd ~/oneinstack    // Must enter the directory execution under oneinstack
-./vhost.sh    // Do not sh vhost.sh or bash vhost.sh such execution
+~/oneinstack/vhost.sh
 ```
 
 ## How to delete a virtual host
 
 ```bash
-cd ~/oneinstack
-./vhost.sh del
+~/oneinstack/vhost.sh --del
 ```
 
 ## How to add FTP virtual user
 
 ```bash
-cd ~/oneinstack
-./pureftpd_vhost.sh
+~/oneinstack/pureftpd_vhost.sh
 ```
 
 ## How to backup
@@ -78,7 +74,7 @@ cd ~/oneinstack
 ./backup_setup.sh    // Backup parameters
 ./backup.sh    // Perform the backup immediately
 crontab -l    // Can be added to scheduled tasks, such as automatic backups every day 1:00
-  0 1 * * * cd ~/oneinstack;./backup.sh  > /dev/null 2>&1 &
+  0 1 * * * cd ~/oneinstack/backup.sh  > /dev/null 2>&1 &
 ```
 
 ## How to manage service
@@ -134,13 +130,13 @@ service memcached {start|stop|status|restart|reload}
 ## How to upgrade
 
 ```bash
-./upgrade.sh
+~/oneinstack/upgrade.sh
 ```
 
 ## How to uninstall
 
 ```bash
-./uninstall.sh
+~/oneinstack/uninstall.sh
 ```
 
 ## Installation

+ 4 - 4
addons.sh

@@ -40,7 +40,7 @@ pushd ${oneinstack_dir} > /dev/null
 
 . include/panel.sh
 
-showhelp() {
+Show_Help() {
   echo
   echo "Usage: $0  command ...
   --help, -h                  Show this help message
@@ -55,13 +55,13 @@ showhelp() {
 
 ARG_NUM=$#
 TEMP=`getopt -o hiu --long help,install,uninstall,composer,fail2ban,ngx_lua_waf,python,panel -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     -i|--install)
       install_yn=y; shift 1
@@ -88,7 +88,7 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done

+ 10 - 10
backup.sh

@@ -98,7 +98,7 @@ DB_GDRIVE_BK() {
   done
 }
 
-WEB_Local_BK() {
+WEB_LOCAL_BK() {
   for W in `echo ${website_name} | tr ',' ' '`
   do
     ./website_bk.sh $W
@@ -108,12 +108,12 @@ WEB_Local_BK() {
 WEB_Remote_BK() {
   for W in `echo ${website_name} | tr ',' ' '`
   do
-    if [ `du -sm "${wwwroot_dir}/$WebSite" | awk '{print $1}'` -lt 1024 ]; then
+    if [ `du -sm "${wwwroot_dir}/${WebSite}" | awk '{print $1}'` -lt 2048 ]; then
       ./website_bk.sh $W
       Web_GREP="Web_${W}_`date +%Y%m%d`"
       Web_FILE=`ls -lrt ${backup_dir} | grep ${Web_GREP} | tail -1 | awk '{print $NF}'`
-      echo "file:::${backup_dir}/$Web_FILE ${backup_dir} push" >> config_backup.txt
-      echo "com:::[ -e "${backup_dir}/$Web_FILE" ] && rm -rf ${backup_dir}/Web_${W}_$(date +%Y%m%d --date="${expired_days} days ago")_*.tgz" >> config_backup.txt
+      echo "file:::${backup_dir}/${Web_FILE} ${backup_dir} push" >> config_backup.txt
+      echo "com:::[ -e "${backup_dir}/${Web_FILE}" ] && rm -rf ${backup_dir}/Web_${W}_$(date +%Y%m%d --date="${expired_days} days ago")_*.tgz" >> config_backup.txt
     else
       echo "file:::${wwwroot_dir}/$W ${backup_dir} push" >> config_backup.txt
     fi
@@ -123,7 +123,7 @@ WEB_Remote_BK() {
 WEB_OSS_BK() {
   for W in `echo $website_name | tr ',' ' '`
   do
-    [ ! -e "${wwwroot_dir}/$WebSite" ] && { echo "[${wwwroot_dir}/$WebSite] not exist"; break; }
+    [ ! -e "${wwwroot_dir}/${WebSite}" ] && { echo "[${wwwroot_dir}/${WebSite}] not exist"; break; }
     PUSH_FILE="${backup_dir}/Web_${W}_$(date +%Y%m%d_%H).tgz"
     if [ ! -e "${PUSH_FILE}" ]; then
       pushd ${wwwroot_dir} > /dev/null
@@ -138,7 +138,7 @@ WEB_OSS_BK() {
 WEB_COS_BK() {
   for W in `echo ${website_name} | tr ',' ' '`
   do
-    [ ! -e "${wwwroot_dir}/$WebSite" ] && { echo "[${wwwroot_dir}/$WebSite] not exist"; break; }
+    [ ! -e "${wwwroot_dir}/${WebSite}" ] && { echo "[${wwwroot_dir}/${WebSite}] not exist"; break; }
     PUSH_FILE="${backup_dir}/Web_${W}_$(date +%Y%m%d_%H).tgz"
     if [ ! -e "${PUSH_FILE}" ]; then
       pushd ${wwwroot_dir} > /dev/null
@@ -156,7 +156,7 @@ WEB_COS_BK() {
 WEB_UPYUN_BK() {
   for W in `echo ${website_name} | tr ',' ' '`
   do
-    [ ! -e "${wwwroot_dir}/$WebSite" ] && { echo "[${wwwroot_dir}/$WebSite] not exist"; break; }
+    [ ! -e "${wwwroot_dir}/${WebSite}" ] && { echo "[${wwwroot_dir}/${WebSite}] not exist"; break; }
     [ ! -e "${backup_dir}" ] && mkdir -p ${backup_dir}
     PUSH_FILE="${backup_dir}/Web_${W}_$(date +%Y%m%d_%H).tgz"
     if [ ! -e "${PUSH_FILE}" ]; then
@@ -175,7 +175,7 @@ WEB_UPYUN_BK() {
 WEB_QINIU_BK() {
   for W in `echo ${website_name} | tr ',' ' '`
   do
-    [ ! -e "${wwwroot_dir}/$WebSite" ] && { echo "[${wwwroot_dir}/$WebSite] not exist"; break; }
+    [ ! -e "${wwwroot_dir}/${WebSite}" ] && { echo "[${wwwroot_dir}/${WebSite}] not exist"; break; }
     [ ! -e "${backup_dir}" ] && mkdir -p ${backup_dir}
     PUSH_FILE="${backup_dir}/Web_${W}_$(date +%Y%m%d_%H).tgz"
     if [ ! -e "${PUSH_FILE}" ]; then
@@ -195,7 +195,7 @@ WEB_QINIU_BK() {
 WEB_GDRIVE_BK() {
   for W in `echo ${website_name} | tr ',' ' '`
   do
-    [ ! -e "${wwwroot_dir}/$WebSite" ] && { echo "[${wwwroot_dir}/$WebSite] not exist"; break; }
+    [ ! -e "${wwwroot_dir}/${WebSite}" ] && { echo "[${wwwroot_dir}/${WebSite}] not exist"; break; }
     [ ! -e "${backup_dir}" ] && mkdir -p ${backup_dir}
     PUSH_FILE="${backup_dir}/Web_${W}_$(date +%Y%m%d_%H).tgz"
     if [ ! -e "${PUSH_FILE}" ]; then
@@ -217,7 +217,7 @@ for DEST in `echo ${backup_destination} | tr ',' ' '`
 do
   if [ "${DEST}" == 'local' ]; then
     [ -n "`echo ${backup_content} | grep -ow db`" ] && DB_Local_BK
-    [ -n "`echo ${backup_content} | grep -ow web`" ] && WEB_Local_BK
+    [ -n "`echo ${backup_content} | grep -ow web`" ] && WEB_LOCAL_BK
   fi
   if [ "${DEST}" == 'remote' ]; then
     echo "com:::[ ! -e "${backup_dir}" ] && mkdir -p ${backup_dir}" > config_backup.txt

+ 5 - 5
backup_setup.sh

@@ -148,8 +148,8 @@ echo "You have to backup the content:"
 if [ -n "`echo ${desc_bk} | grep -w 2`" ]; then
   > tools/iplist.txt
   while :; do echo
-    read -e -p "Please enter the remote host ip: " remote_ip
-    [ -z "${remote_ip}" -o "${remote_ip}" == '127.0.0.1' ] && continue
+    read -e -p "Please enter the remote host address: " remote_address
+    [ -z "${remote_address}" -o "${remote_address}" == '127.0.0.1' ] && continue
     echo
     read -e -p "Please enter the remote host port(Default: 22) : " remote_port
     remote_port=${remote_port:-22}
@@ -158,13 +158,13 @@ if [ -n "`echo ${desc_bk} | grep -w 2`" ]; then
     remote_user=${remote_user:-root}
     echo
     read -e -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')
+    IPcode=$(echo "ibase=16;$(echo "${remote_address}" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
     Portcode=$(echo "ibase=16;$(echo "${remote_port}" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
     PWcode=$(echo "ibase=16;$(echo "$remote_password" | xxd -ps -u)"|bc|tr -d '\\'|tr -d '\n')
-    [ -e "~/.ssh/known_hosts" ] && grep ${remote_ip} ~/.ssh/known_hosts | sed -i "/${remote_ip}/d" ~/.ssh/known_hosts
+    [ -e "~/.ssh/known_hosts" ] && grep ${remote_address} ~/.ssh/known_hosts | sed -i "/${remote_address}/d" ~/.ssh/known_hosts
     ./tools/mssh.exp ${IPcode}P ${remote_user} ${PWcode}P ${Portcode}P true 10
     if [ $? -eq 0 ]; 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}"
+      [ -z "`grep ${remote_address} tools/iplist.txt`" ] && echo "${remote_address} ${remote_port} ${remote_user} $remote_password" >> tools/iplist.txt || echo "${CWARNING}${remote_address} has been added! ${CEND}"
       while :; do
         read -e -p "Do you want to add more host ? [y/n]: " morehost_yn
         if [[ ! ${morehost_yn} =~ ^[y,n]$ ]]; then

+ 2 - 2
include/GraphicsMagick.sh

@@ -30,7 +30,7 @@ Uninstall_GraphicsMagick() {
   fi
 }
 
-Install_pecl-gmagick() {
+Install_pecl_gmagick() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
@@ -57,7 +57,7 @@ Install_pecl-gmagick() {
   fi
 }
 
-Uninstall_pecl-gmagick() {
+Uninstall_pecl_gmagick() {
   if [ -e "${php_install_dir}/etc/php.d/03-gmagick.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/03-gmagick.ini
     echo; echo "${CMSG}PHP gmagick module uninstall completed${CEND}"

+ 2 - 2
include/ImageMagick.sh

@@ -30,7 +30,7 @@ Uninstall_ImageMagick() {
   fi
 }
 
-Install_pecl-imagick() {
+Install_pecl_imagick() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
@@ -52,7 +52,7 @@ Install_pecl-imagick() {
   fi
 }
 
-Uninstall_pecl-imagick() {
+Uninstall_pecl_imagick() {
   if [ -e "${php_install_dir}/etc/php.d/03-imagick.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/03-imagick.ini
     echo; echo "${CMSG}PHP imagick module uninstall completed${CEND}"

+ 2 - 3
include/demo.sh

@@ -19,7 +19,6 @@ DEMO() {
     else
       src_url=http://mirrors.linuxeye.com/oneinstack/src/tz_e.zip && Download_src
       unzip -q tz_e.zip -d ${wwwroot_dir}/default;/bin/mv ${wwwroot_dir}/default/{tz_e.php,prober.php}
-      sed -i "s@date_default_timezone_set('Asia/Shanghai')@date_default_timezone_set('"$timezone"')@" $wwwroot_dir/default/prober.php
     fi
 
     echo "<?php phpinfo() ?>" > ${wwwroot_dir}/default/phpinfo.php
@@ -44,6 +43,6 @@ DEMO() {
     esac
   fi
   chown -R ${run_user}.${run_user} ${wwwroot_dir}/default
-  [ -e /usr/bin/systemctl ] && systemctl daemon-reload
-  popd
+  [ -e /bin/systemctl ] && systemctl daemon-reload
+  popd > /dev/null
 }

+ 1 - 1
include/init_CentOS.sh

@@ -48,7 +48,7 @@ EOF
 
 # Set timezone
 rm -rf /etc/localtime
-ln -s /usr/share/zoneinfo/$timezone /etc/localtime
+ln -s /usr/share/zoneinfo/${timezone} /etc/localtime
 
 # Set DNS
 #cat > /etc/resolv.conf << EOF

+ 1 - 1
include/init_Debian.sh

@@ -52,7 +52,7 @@ EOF
 
 # Set timezone
 rm -rf /etc/localtime
-ln -s /usr/share/zoneinfo/$timezone /etc/localtime
+ln -s /usr/share/zoneinfo/${timezone} /etc/localtime
 
 # Set DNS
 #cat > /etc/resolv.conf << EOF

+ 1 - 1
include/init_Ubuntu.sh

@@ -54,7 +54,7 @@ EOF
 
 # Set timezone
 rm -rf /etc/localtime
-ln -s /usr/share/zoneinfo/$timezone /etc/localtime
+ln -s /usr/share/zoneinfo/${timezone} /etc/localtime
 
 # Set DNS
 #cat > /etc/resolv.conf << EOF

+ 1 - 1
include/jdk-1.6.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install-JDK16() {
+Install_JDK16() {
   pushd ${oneinstack_dir}/src > /dev/null
   JDK_FILE="jdk-`echo ${jdk16_ver} | awk -F. '{print $2}'`u`echo ${jdk16_ver} | awk -F_ '{print $NF}'`-linux-${SYS_BIT_j}.bin"
   JAVA_dir=/usr/java

+ 1 - 1
include/jdk-1.7.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install-JDK17() {
+Install_JDK17() {
   pushd ${oneinstack_dir}/src > /dev/null
   JDK_FILE="jdk-`echo ${jdk17_ver} | awk -F. '{print $2}'`u`echo ${jdk17_ver} | awk -F_ '{print $NF}'`-linux-${SYS_BIT_j}.tar.gz"
   JAVA_dir=/usr/java

+ 1 - 1
include/jdk-1.8.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install-JDK18() {
+Install_JDK18() {
   pushd ${oneinstack_dir}/src > /dev/null
   JDK_FILE="jdk-`echo ${jdk18_ver} | awk -F. '{print $2}'`u`echo ${jdk18_ver} | awk -F_ '{print $NF}'`-linux-${SYS_BIT_j}.tar.gz"
   JAVA_dir=/usr/java

+ 1 - 1
include/jdk-11.0.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install-JDK110() {
+Install_JDK110() {
   pushd ${oneinstack_dir}/src > /dev/null
   JDK_FILE="jdk-${jdk110_ver}_linux-${SYS_BIT_j}_bin.tar.gz"
   JAVA_dir=/usr/java

+ 5 - 5
include/memcached.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_memcached-server() {
+Install_memcached_server() {
   pushd ${oneinstack_dir}/src > /dev/null
   # memcached server
   id -u memcached >/dev/null 2>&1
@@ -42,7 +42,7 @@ Install_memcached-server() {
   popd > /dev/null
 }
 
-Install_pecl-memcache() {
+Install_pecl_memcache() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
@@ -76,7 +76,7 @@ Install_pecl-memcache() {
   fi
 }
 
-Install_pecl-memcached() {
+Install_pecl_memcached() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
@@ -116,7 +116,7 @@ EOF
   fi
 }
 
-Uninstall_pecl-memcache() {
+Uninstall_pecl_memcache() {
   if [ -e "${php_install_dir}/etc/php.d/05-memcache.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/05-memcache.ini
     echo; echo "${CMSG}PHP memcache module uninstall completed${CEND}"
@@ -125,7 +125,7 @@ Uninstall_pecl-memcache() {
   fi
 }
 
-Uninstall_pecl-memcached() {
+Uninstall_pecl_memcached() {
   if [ -e "${php_install_dir}/etc/php.d/05-memcached.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/05-memcached.ini
     echo; echo "${CMSG}PHP memcached module uninstall completed${CEND}"

+ 3 - 13
include/memory.sh

@@ -37,21 +37,11 @@ elif [ $Mem -gt 8000 ]; then
   Memory_limit=448
 fi
 
-Make-swapfile() {
-  dd if=/dev/zero of=/swapfile count=$COUNT bs=1M
+# add swapfile
+if [ "${Swap}" == '0' ] && [ ${Mem} -le 2048 ]; then
+  dd if=/dev/zero of=/swapfile count=2048 bs=1M
   mkswap /swapfile
   swapon /swapfile
   chmod 600 /swapfile
   [ -z "`grep swapfile /etc/fstab`" ] && echo '/swapfile    swap    swap    defaults    0 0' >> /etc/fstab
-}
-
-# add swapfile
-if [ "$Swap" == '0' ]; then
-  if [ $Mem -le 1024 ]; then
-    COUNT=1024
-    Make-swapfile
-  elif [ $Mem -gt 1024 -a $Mem -le 2048 ]; then
-    COUNT=2048
-    Make-swapfile
-  fi
 fi

+ 2 - 2
include/pecl_fileinfo.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-fileinfo() {
+Install_pecl_fileinfo() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
@@ -31,7 +31,7 @@ Install_pecl-fileinfo() {
   fi
 }
 
-Uninstall_pecl-fileinfo() {
+Uninstall_pecl_fileinfo() {
   if [ -e "${php_install_dir}/etc/php.d/04-fileinfo.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/04-fileinfo.ini
     echo; echo "${CMSG}PHP fileinfo module uninstall completed${CEND}"

+ 2 - 2
include/pecl_imap.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-imap() {
+Install_pecl_imap() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     if [ "${PM}" == 'yum' ]; then
@@ -37,7 +37,7 @@ Install_pecl-imap() {
   fi
 }
 
-Uninstall_pecl-imap() {
+Uninstall_pecl_imap() {
   if [ -e "${php_install_dir}/etc/php.d/04-imap.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/04-imap.ini
     echo; echo "${CMSG}PHP imap module uninstall completed${CEND}"

+ 2 - 2
include/pecl_mongodb.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-mongodb() {
+Install_pecl_mongodb() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
@@ -47,7 +47,7 @@ Install_pecl-mongodb() {
   fi
 }
 
-Uninstall_pecl-mongodb() {
+Uninstall_pecl_mongodb() {
   if [ -e "${php_install_dir}/etc/php.d/07-mongo.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/07-mongo.ini
     echo; echo "${CMSG}PHP mongo module uninstall completed${CEND}"

+ 2 - 2
include/pecl_pgsql.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-pgsql() {
+Install_pecl_pgsql() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
@@ -36,7 +36,7 @@ Install_pecl-pgsql() {
   fi
 }
 
-Uninstall_pecl-pgsql() {
+Uninstall_pecl_pgsql() {
   if [ -e "${php_install_dir}/etc/php.d/07-pgsql.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/07-pgsql.ini
     echo; echo "${CMSG}PHP pgsql module uninstall completed${CEND}"

+ 2 - 2
include/pecl_phalcon.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-phalcon() {
+Install_pecl_phalcon() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     PHP_detail_ver=$(${php_install_dir}/bin/php -r 'echo PHP_VERSION;')
@@ -35,7 +35,7 @@ Install_pecl-phalcon() {
   fi
 }
 
-Uninstall_pecl-phalcon() {
+Uninstall_pecl_phalcon() {
   if [ -e "${php_install_dir}/etc/php.d/04-phalcon.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/04-phalcon.ini
     echo; echo "${CMSG}PHP phalcon module uninstall completed${CEND}"

+ 2 - 2
include/pecl_swoole.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-swoole() {
+Install_pecl_swoole() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
@@ -38,7 +38,7 @@ Install_pecl-swoole() {
   fi
 }
 
-Uninstall_pecl-swoole() {
+Uninstall_pecl_swoole() {
   if [ -e "${php_install_dir}/etc/php.d/06-swoole.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/06-swoole.ini
     echo; echo "${CMSG}PHP swoole module uninstall completed${CEND}"

+ 2 - 2
include/pecl_xdebug.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_pecl-xdebug() {
+Install_pecl_xdebug() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     PHP_detail_ver=$(${php_install_dir}/bin/php -r 'echo PHP_VERSION;')
@@ -57,7 +57,7 @@ EOF
   fi
 }
 
-Uninstall_pecl-xdebug() {
+Uninstall_pecl_xdebug() {
   if [ -e "${php_install_dir}/etc/php.d/08-xdebug.ini" ]; then
     rm -rf ${php_install_dir}/etc/php.d/08-xdebug.ini /tmp/{xdebug,webgrind} ${wwwroot_dir}/default/webgrind
     echo; echo "${CMSG}PHP xdebug module uninstall completed${CEND}"

+ 1 - 1
include/php-5.3.sh

@@ -142,7 +142,7 @@ Install_PHP53() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-5.4.sh

@@ -137,7 +137,7 @@ Install_PHP54() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-5.5.sh

@@ -136,7 +136,7 @@ Install_PHP55() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-5.6.sh

@@ -137,7 +137,7 @@ Install_PHP56() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-7.0.sh

@@ -138,7 +138,7 @@ Install_PHP70() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 600@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-7.1.sh

@@ -138,7 +138,7 @@ Install_PHP71() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 600@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-7.2.sh

@@ -132,7 +132,7 @@ Install_PHP72() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 600@' ${php_install_dir}/etc/php.ini

+ 1 - 1
include/php-7.3.sh

@@ -132,7 +132,7 @@ Install_PHP73() {
   sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
   sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
   sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^;date.timezone.*@date.timezone = '$timezone'@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
   sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^max_execution_time.*@max_execution_time = 600@' ${php_install_dir}/etc/php.ini

+ 3 - 3
include/redis.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_redis-server() {
+Install_redis_server() {
   pushd ${oneinstack_dir}/src > /dev/null
   tar xzf redis-${redis_ver}.tar.gz
   pushd redis-${redis_ver} > /dev/null
@@ -57,7 +57,7 @@ Install_redis-server() {
   popd > /dev/null
 }
 
-Install_pecl-redis() {
+Install_pecl_redis() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
@@ -78,7 +78,7 @@ Install_pecl-redis() {
   fi
 }
 
-Uninstall_pecl-redis() {
+Uninstall_pecl_redis() {
   if [ -e "${php_install_dir}/etc/php.d/05-redis.ini" ]; then
     rm -f ${php_install_dir}/etc/php.d/05-redis.ini
     echo; echo "${CMSG}PHP redis module uninstall completed${CEND}"

+ 1 - 1
include/upgrade_oneinstack.sh

@@ -30,7 +30,7 @@ Upgrade_OneinStack() {
       IFS=$IFS_old
       Key="`echo ${L%%=*}`"
       Value="`echo ${L#*=}`"
-      sed -i "s@^${Key}=.*@${Key}=${Value}@" ./options.conf
+      sed -i "s|^${Key}=.*|${Key}=${Value}|" ./options.conf
     done
     rm -rf /tmp/{oneinstack.tar.gz,options.conf}
     [ "${ois_flag}" == 'n' ] && rm -f ss.sh LICENSE README.md

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

@@ -25,7 +25,7 @@ fi
 RETVAL=0
 prog="memcached"
 
-start () {
+start() {
   echo -n $"Starting $prog: "
   # Make sure the default pidfile directory exists
   if [ ! -d $PIDDIR ]; then
@@ -36,7 +36,7 @@ start () {
   echo
   [ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
 }
-stop () {
+stop() {
   echo -n $"Stopping $prog: "
   killproc memcached
   RETVAL=$?
@@ -47,7 +47,7 @@ stop () {
   fi
 }
 
-restart () {
+restart() {
   stop
   start
 }

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

@@ -45,7 +45,7 @@ stop_instance() {
     rm -f /var/run/memcached/memcached.$1.pid
   fi
 }
-start () {
+start() {
   # insure that /var/run/memcached has proper permissions
   mkdir -p /var/run/memcached
   if [ "$(stat -c %U /var/run/memcached)" != "$USER" ]; then
@@ -62,7 +62,7 @@ start () {
   #start_instance update 8;
   #start_instance views 8;
 }
-stop () {
+stop() {
   stop_instance default;
   #stop_instance block;
   #stop_instance content;
@@ -74,7 +74,7 @@ stop () {
   #stop_instance views;
 }
 
-restart () {
+restart() {
   stop
   start
 }

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

@@ -82,7 +82,7 @@ stop()
   [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mongod
 }
 
-restart () {
+restart() {
         stop
         start
 }

+ 3 - 3
init.d/SS-python-init

@@ -23,7 +23,7 @@ SS_USAGE="Usage: $0 {\e[00;32mstart\e[00m|\e[00;31mstop\e[00m|\e[00;32mstatus\e[
 #SHUTDOWN_WAIT is wait time in seconds for SS proccess to stop
 SHUTDOWN_WAIT=20
 
-SS_pid(){
+SS_pid() {
   echo `ps -ef | grep $SS_bin | grep -v grep | tr -s " "|cut -d" " -f2`
 }
 
@@ -44,7 +44,7 @@ start() {
   return 0
 }
 
-status(){
+status() {
   pid=$(SS_pid)
   if [ -n "$pid" ]; then
     echo -e "\e[00;32mSS is running with pid: $pid\e[00m"
@@ -53,7 +53,7 @@ status(){
   fi
 }
 
-stop(){
+stop() {
   pid=$(SS_pid)
   if [ -n "$pid" ]; then
     echo -e "\e[00;31mStoping SS\e[00m"

+ 22 - 22
install.sh

@@ -41,7 +41,7 @@ version() {
   echo "updated date: 2019-01-04"
 }
 
-showhelp() {
+Show_Help() {
   version
   echo "Usage: $0  command ...[parameters]....
   --help, -h                  Show this help message, More: https://oneinstack.com/auto
@@ -70,13 +70,13 @@ showhelp() {
 }
 ARG_NUM=$#
 TEMP=`getopt -o hvV --long help,version,nginx_option:,apache_option:,php_option:,phpcache_option:,php_extensions:,tomcat_option:,jdk_option:,db_option:,dbrootpwd:,dbinstallmethod:,pureftpd,redis,memcached,phpmyadmin,hhvm,ssh_port:,iptables,reboot -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     -v|-V|--version)
       version; exit 0
@@ -188,7 +188,7 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done
@@ -910,93 +910,93 @@ fi
 if [ "${pecl_imagick}" == '1' ]; then
   . include/ImageMagick.sh
   Install_ImageMagick 2>&1 | tee -a ${oneinstack_dir}/install.log
-  Install_pecl-imagick 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_imagick 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # gmagick
 if [ "${pecl_gmagick}" == '1' ]; then
   . include/GraphicsMagick.sh
   Install_GraphicsMagick 2>&1 | tee -a ${oneinstack_dir}/install.log
-  Install_pecl-gmagick 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_gmagick 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # fileinfo
 if [ "${pecl_fileinfo}" == '1' ]; then
   . include/pecl_fileinfo.sh
-  Install_pecl-fileinfo 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_fileinfo 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # imap
 if [ "${pecl_imap}" == '1' ]; then
   . include/pecl_imap.sh
-  Install_pecl-imap 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_imap 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # phalcon
 if [ "${pecl_phalcon}" == '1' ]; then
   . include/pecl_phalcon.sh
-  Install_pecl-phalcon 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_phalcon 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # pecl_memcached
 if [ "${pecl_memcached}" == '1' ]; then
   . include/memcached.sh
-  Install_pecl-memcached 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_memcached 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # pecl_memcache
 if [ "${pecl_memcache}" == '1' ]; then
   . include/memcached.sh
-  Install_pecl-memcache 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_memcache 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # pecl_redis
 if [ "${pecl_redis}" == '1' ]; then
   . include/redis.sh
-  Install_pecl-redis 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_redis 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # pecl_mongodb
 if [ "${pecl_mongodb}" == '1' ]; then
   . include/pecl_mongodb.sh
-  Install_pecl-mongodb 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_mongodb 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # swoole
 if [ "${pecl_swoole}" == '1' ]; then
   . include/pecl_swoole.sh
-  Install_pecl-swoole 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_swoole 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # xdebug
 if [ "${pecl_xdebug}" == '1' ]; then
   . include/pecl_xdebug.sh
-  Install_pecl-xdebug 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_xdebug 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # pecl_pgsql
 if [ -e "${pgsql_install_dir}/bin/psql" ]; then
   . include/pecl_pgsql.sh
-  Install_pecl-pgsql 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_pecl_pgsql 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # JDK
 case "${jdk_option}" in
   1)
     . include/jdk-11.0.sh
-    Install-JDK110 2>&1 | tee -a ${oneinstack_dir}/install.log
+    Install_JDK110 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
   2)
     . include/jdk-1.8.sh
-    Install-JDK18 2>&1 | tee -a ${oneinstack_dir}/install.log
+    Install_JDK18 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
   3)
     . include/jdk-1.7.sh
-    Install-JDK17 2>&1 | tee -a ${oneinstack_dir}/install.log
+    Install_JDK17 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
   4)
     . include/jdk-1.6.sh
-    Install-JDK16 2>&1 | tee -a ${oneinstack_dir}/install.log
+    Install_JDK16 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
 esac
 
@@ -1034,13 +1034,13 @@ fi
 # redis
 if [ "${redis_yn}" == 'y' ]; then
   . include/redis.sh
-  Install_redis-server 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_redis_server 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # memcached
 if [ "${memcached_yn}" == 'y' ]; then
   . include/memcached.sh
-  Install_memcached-server 2>&1 | tee -a ${oneinstack_dir}/install.log
+  Install_memcached_server 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # index example

+ 1 - 1
options.conf

@@ -1,5 +1,5 @@
 # set the default timezone
-timezone=UTC
+timezone=Asia/Shanghai
 
 # Nginx Apache and PHP-FPM process is run as $run_user(Default "www"), you can freely specify
 run_user=www

+ 4 - 4
pureftpd_vhost.sh

@@ -35,7 +35,7 @@ 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; }
 
 ARG_NUM=$#
-showhelp() {
+Show_Help() {
   echo
   echo "Usage: $0  command ...[parameters]....
   --help, -h                          Show this help message
@@ -52,13 +52,13 @@ showhelp() {
 }
 
 TEMP=`getopt -o hu:p:d:D: --long help,useradd,add,usermod,passwd,userdel,delete,listalluser,list,showuser,username:,password:,directory: -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     --add|--useradd)
       useradd_quiet=y; shift 1
@@ -91,7 +91,7 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done

+ 4 - 4
reset_db_root_password.sh

@@ -24,7 +24,7 @@ pushd ${oneinstack_dir} > /dev/null
 . ./include/check_dir.sh
 [ ! -d "${db_install_dir}" ] && { echo "${CFAILURE}Database is not installed on your system! ${CEND}"; exit 1; }
 
-showhelp() {
+Show_Help() {
   echo "Usage: $0  command ...[parameters]....
   -h,  --help                  print this help.
   -q,  --quiet                 quiet operation.
@@ -35,13 +35,13 @@ showhelp() {
 
 New_dbrootpwd="`< /dev/urandom tr -dc A-Za-z0-9 | head -c8`"
 TEMP=`getopt -o hqfp: --long help,quiet,force,password: -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     -q|--quiet)
       quiet_yn=y; shift 1
@@ -57,7 +57,7 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done

+ 11 - 11
ss.sh

@@ -32,7 +32,7 @@ pushd ${oneinstack_dir}/src > /dev/null
 
 PUBLIC_IPADDR=$(../include/get_public_ipaddr.py)
 
-showhelp() {
+Show_Help() {
   echo
   echo "Usage: $0  command ...[parameters]....
   --help, -h                  Show this help message
@@ -48,13 +48,13 @@ showhelp() {
 }
 ARG_NUM=$#
 TEMP=`getopt -o hqiu --long help,quiet,install,uninstall,libev,python,adduser,password:,port: -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     -q|--quiet)
       quiet_yn=y; shift 1
@@ -84,7 +84,7 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done
@@ -104,7 +104,7 @@ AddUser_SS() {
   done
 }
 
-Iptables_set() {
+Iptables() {
   if [ -e '/etc/sysconfig/iptables' ]; then
     SS_Already_port=$(grep -oE '9[0-9][0-9][0-9]' /etc/sysconfig/iptables | head -n 1)
   elif [ -e '/etc/iptables/rules.v4' ]; then
@@ -174,7 +174,7 @@ Def_parameter() {
     fi
   done
   AddUser_SS
-  Iptables_set
+  Iptables
   if [ "${PM}" == 'yum' ]; then
     pkgList="wget unzip openssl-devel gcc swig autoconf libtool libevent automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel git asciidoc xmlto c-ares-devel pcre-devel udns-devel libev-devel"
     for Package in ${pkgList}; do
@@ -189,7 +189,7 @@ Def_parameter() {
   fi
 }
 
-Install_SS-python() {
+Install_SS_python() {
   Install_Python
   ${python_install_dir}/bin/pip install M2Crypto
   ${python_install_dir}/bin/pip install greenlet
@@ -215,7 +215,7 @@ Install_SS-python() {
   fi
 }
 
-Install_SS-libev() {
+Install_SS_libev() {
   src_url=http://mirrors.linuxeye.com/oneinstack/src/shadowsocks-libev-3.2.3.tar.gz && Download_src
   src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
   src_url=http://mirrors.linuxeye.com/oneinstack/src/mbedtls-2.16.0-apache.tgz && Download_src
@@ -345,8 +345,8 @@ Your Encryption Method: ${CMSG}aes-256-cfb${CEND}
 
 if [ "${install_yn}" == 'y' -o "${ARG_NUM}" == '0' ]; then
   Def_parameter
-  [ "${ss_option}" == '1' ] && Install_SS-libev
-  [ "${ss_option}" == '2' ] && Install_SS-python
+  [ "${ss_option}" == '1' ] && Install_SS_libev
+  [ "${ss_option}" == '2' ] && Install_SS_python
   Config_SS
   service shadowsocks start
   Print_User_SS
@@ -356,7 +356,7 @@ if [ "${adduser_yn}" == 'y' ]; then
   Check_SS
   if [ "${ss_option}" == '2' ]; then
     AddUser_SS
-    Iptables_set
+    Iptables
     AddUser_Config_SS
     service shadowsocks restart
     Print_User_SS

+ 31 - 31
uninstall.sh

@@ -27,7 +27,7 @@ pushd ${oneinstack_dir} > /dev/null
 . ./include/get_char.sh
 . ./include/check_dir.sh
 
-showhelp() {
+Show_Help() {
   echo
   echo "Usage: $0  command ...[parameters]....
   --help, -h                    Show this help message, More: https://oneinstack.com
@@ -52,13 +52,13 @@ showhelp() {
 
 ARG_NUM=$#
 TEMP=`getopt -o hvVq --long help,version,quiet,all,web,mysql,postgresql,mongodb,php,phpcache,php_extensions:,hhvm,pureftpd,redis,memcached,phpmyadmin -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     -q|--quiet)
       quiet_yn=y
@@ -133,7 +133,7 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done
@@ -310,68 +310,68 @@ Uninstall_PHPext() {
   if [ "${pecl_imagick}" == '1' ]; then
     . include/ImageMagick.sh
     Uninstall_ImageMagick
-    Uninstall_pecl-imagick
+    Uninstall_pecl_imagick
   fi
 
   # gmagick
   if [ "${pecl_gmagick}" == '1' ]; then
     . include/GraphicsMagick.sh
     Uninstall_GraphicsMagick
-    Uninstall_pecl-gmagick
+    Uninstall_pecl_gmagick
   fi
 
   # fileinfo
   if [ "${pecl_fileinfo}" == '1' ]; then
     . include/pecl_fileinfo.sh
-    Uninstall_pecl-fileinfo
+    Uninstall_pecl_fileinfo
   fi
 
   # imap
   if [ "${pecl_imap}" == '1' ]; then
     . include/pecl_imap.sh
-    Uninstall_pecl-imap
+    Uninstall_pecl_imap
   fi
 
   # phalcon
   if [ "${pecl_phalcon}" == '1' ]; then
     . include/pecl_phalcon.sh
-    Uninstall_pecl-phalcon
+    Uninstall_pecl_phalcon
   fi
 
   # pecl_memcached
   if [ "${pecl_memcached}" == '1' ]; then
     . include/memcached.sh
-    Uninstall_pecl-memcached
+    Uninstall_pecl_memcached
   fi
 
   # pecl_memcache
   if [ "${pecl_memcache}" == '1' ]; then
     . include/memcached.sh
-    Uninstall_pecl-memcache
+    Uninstall_pecl_memcache
   fi
 
   # pecl_redis
   if [ "${pecl_redis}" == '1' ]; then
     . include/redis.sh
-    Uninstall_pecl-redis
+    Uninstall_pecl_redis
   fi
 
   # pecl_mongodb
   if [ "${pecl_mongodb}" == '1' ]; then
     . include/pecl_mongodb.sh
-    Uninstall_pecl-mongodb
+    Uninstall_pecl_mongodb
   fi
 
   # swoole
   if [ "${pecl_swoole}" == '1' ]; then
     . include/pecl_swoole.sh
-    Uninstall_pecl-swoole
+    Uninstall_pecl_swoole
   fi
 
   # xdebug
   if [ "${pecl_xdebug}" == '1' ]; then
     . include/pecl_xdebug.sh
-    Uninstall_pecl-xdebug
+    Uninstall_pecl_xdebug
   fi
 
   # reload php
@@ -456,24 +456,24 @@ Uninstall_PureFtpd() {
   [ -e "/lib/systemd/system/pureftpd.service" ] && { systemctl disable pureftpd > /dev/null 2>&1; rm -f /lib/systemd/system/pureftpd.service; }
 }
 
-Print_Redis-server() {
+Print_Redis_server() {
   [ -e "${redis_install_dir}" ] && echo "${redis_install_dir}"
   [ -e "/etc/init.d/redis-server" ] && echo "/etc/init.d/redis-server"
   [ -e "/lib/systemd/system/redis-server.service" ] && echo '/lib/systemd/system/redis-server.service'
 }
 
-Uninstall_Redis-server() {
+Uninstall_Redis_server() {
   [ -e "${redis_install_dir}" ] && { service redis-server stop > /dev/null 2>&1; rm -rf ${redis_install_dir} /etc/init.d/redis-server /usr/local/bin/redis-*; echo "${CMSG}Redis uninstall completed! ${CEND}"; }
   [ -e "/lib/systemd/system/redis-server.service" ] && { systemctl disable redis-server > /dev/null 2>&1; rm -f /lib/systemd/system/redis-server.service; }
 }
 
-Print_Memcached-server() {
+Print_Memcached_server() {
   [ -e "${memcached_install_dir}" ] && echo "${memcached_install_dir}"
   [ -e "/etc/init.d/memcached" ] && echo "/etc/init.d/memcached"
   [ -e "/usr/bin/memcached" ] && echo "/usr/bin/memcached"
 }
 
-Uninstall_Memcached-server() {
+Uninstall_Memcached_server() {
   [ -e "${memcached_install_dir}" ] && { service memcached stop > /dev/null 2>&1; rm -rf ${memcached_install_dir} /etc/init.d/memcached /usr/bin/memcached; echo "${CMSG}Memcached uninstall completed! ${CEND}"; }
 }
 
@@ -527,8 +527,8 @@ What Are You Doing?
       Print_PHP
       Print_HHVM
       Print_PureFtpd
-      Print_Redis-server
-      Print_Memcached-server
+      Print_Redis_server
+      Print_Memcached_server
       Print_openssl
       Print_phpMyAdmin
       Uninstall_status
@@ -540,8 +540,8 @@ What Are You Doing?
         Uninstall_PHP
         Uninstall_HHVM
         Uninstall_PureFtpd
-        Uninstall_Redis-server
-        Uninstall_Memcached-server
+        Uninstall_Redis_server
+        Uninstall_Memcached_server
         Uninstall_openssl
         Uninstall_phpMyAdmin
       else
@@ -597,14 +597,14 @@ What Are You Doing?
       [ "${uninstall_yn}" == 'y' ] && Uninstall_PureFtpd || exit
       ;;
     10)
-      Print_Redis-server
+      Print_Redis_server
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_Redis-server || exit
+      [ "${uninstall_yn}" == 'y' ] && Uninstall_Redis_server || exit
       ;;
     11)
-      Print_Memcached-server
+      Print_Memcached_server
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_Memcached-server || exit
+      [ "${uninstall_yn}" == 'y' ] && Uninstall_Memcached_server || exit
       ;;
     12)
       Print_phpMyAdmin
@@ -629,8 +629,8 @@ else
   [ "${php_yn}" == 'y' ] && Print_PHP
   [ "${hhvm_yn}" == 'y' ] && Print_HHVM
   [ "${pureftpd_yn}" == 'y' ] && Print_PureFtpd
-  [ "${redis_yn}" == 'y' ] && Print_Redis-server
-  [ "${memcached_yn}" == 'y' ] && Print_Memcached-server
+  [ "${redis_yn}" == 'y' ] && Print_Redis_server
+  [ "${memcached_yn}" == 'y' ] && Print_Memcached_server
   [ "${phpmyadmin_yn}" == 'y' ] && Print_phpMyAdmin
   [ "${all_yn}" == 'y' ] && Print_openssl
   Uninstall_status
@@ -644,8 +644,8 @@ else
     [ "${php_yn}" == 'y' ] && Uninstall_PHP
     [ "${hhvm_yn}" == 'y' ] && Uninstall_HHVM
     [ "${pureftpd_yn}" == 'y' ] && Uninstall_PureFtpd
-    [ "${redis_yn}" == 'y' ] && Uninstall_Redis-server
-    [ "${memcached_yn}" == 'y' ] && Uninstall_Memcached-server
+    [ "${redis_yn}" == 'y' ] && Uninstall_Redis_server
+    [ "${memcached_yn}" == 'y' ] && Uninstall_Memcached_server
     [ "${phpmyadmin_yn}" == 'y' ] && Uninstall_phpMyAdmin
     [ "${all_yn}" == 'y' ] && Uninstall_openssl
   fi

+ 5 - 5
upgrade.sh

@@ -41,7 +41,7 @@ pushd ${oneinstack_dir} > /dev/null
 PUBLIC_IPADDR=$(./include/get_public_ipaddr.py)
 IPADDR_COUNTRY=$(./include/get_ipaddr_state.py ${PUBLIC_IPADDR})
 
-showhelp() {
+Show_Help() {
   echo
   echo "Usage: $0  command ...[version]....
   --help, -h                  Show this help message
@@ -62,13 +62,13 @@ showhelp() {
 
 ARG_NUM=$#
 TEMP=`getopt -o h --long help,nginx:,tengine:,openresty:,apache:,tomcat:,db:,php:,redis:,memcached:,phpmyadmin:,oneinstack,acme.sh -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     --nginx)
       nginx_quiet=y; NEW_nginx_ver=$2; shift 2
@@ -107,12 +107,12 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done
 
-Menu(){
+Menu() {
   while :; do
     printf "
 What Are You Doing?

+ 1 - 1
versions.txt

@@ -74,7 +74,7 @@ apcu_ver=5.1.16
 apcu_oldver=4.0.11
 eaccelerator_ver=0.9.6.1
 phalcon_ver=3.4.2
-swoole_ver=4.2.11
+swoole_ver=4.2.12
 swoole_oldver=1.10.5
 xdebug_ver=2.6.1
 xdebug_oldver=2.5.5

+ 19 - 19
vhost.sh

@@ -27,7 +27,7 @@ pushd ${oneinstack_dir} > /dev/null
 . ./include/check_os.sh
 . ./include/get_char.sh
 
-showhelp() {
+Show_Help() {
   echo
   echo "Usage: $0  command ...[parameters]....
   --help, -h                  Show this help message
@@ -44,13 +44,13 @@ showhelp() {
 
 ARG_NUM=$#
 TEMP=`getopt -o hql --long help,quiet,list,add,delete,del,httponly,selfsigned,letsencrypt,dnsapi -- "$@" 2>/dev/null`
-[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+[ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
     -h|--help)
-      showhelp; exit 0
+      Show_Help; exit 0
       ;;
     -q|--quiet)
       quiet_yn=y; shift 1
@@ -92,12 +92,12 @@ while :; do
       shift
       ;;
     *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
       ;;
   esac
 done
 
-Choose_env() {
+Choose_ENV() {
   if [ -e "${apache_install_dir}/bin/apachectl" ];then
     [ "$(${apache_install_dir}/bin/apachectl -v | awk -F'.' /version/'{print $2}')" == '4' ] && { Apache_flag=24; Apache_grant='Require all granted'; }
     [ "$(${apache_install_dir}/bin/apachectl -v | awk -F'.' /version/'{print $2}')" == '2' ] && Apache_flag=22
@@ -317,7 +317,7 @@ EOF
   fi
 }
 
-Print_ssl() {
+Print_SSL() {
   if [ "${Domian_Mode}" == '2' ]; then
     echo "$(printf "%-30s" "Self-signed SSL Certificate:")${CMSG}${PATH_SSL}/${domain}.crt${CEND}"
     echo "$(printf "%-30s" "SSL Private Key:")${CMSG}${PATH_SSL}/${domain}.key${CEND}"
@@ -616,7 +616,7 @@ EOF
   echo "$(printf "%-30s" "Nginx Virtualhost conf:")${CMSG}${web_install_dir}/conf/vhost/${domain}.conf${CEND}"
   echo "$(printf "%-30s" "Tomcat Virtualhost conf:")${CMSG}${tomcat_install_dir}/conf/vhost/${domain}.xml${CEND}"
   echo "$(printf "%-30s" "Directory of:")${CMSG}${vhostdir}${CEND}"
-  Print_ssl
+  Print_SSL
 }
 
 Create_tomcat_conf() {
@@ -645,7 +645,7 @@ EOF
   echo "$(printf "%-30s" "index url:")${CMSG}http://${domain}:8080/${CEND}"
 }
 
-Create_nginx_php-fpm_hhvm_conf() {
+Create_nginx_phpfpm_hhvm_conf() {
   [ ! -d ${web_install_dir}/conf/vhost ] && mkdir ${web_install_dir}/conf/vhost
   cat > ${web_install_dir}/conf/vhost/${domain}.conf << EOF
 server {
@@ -733,7 +733,7 @@ EOF
   echo "$(printf "%-30s" "Virtualhost conf:")${CMSG}${web_install_dir}/conf/vhost/${domain}.conf${CEND}"
   echo "$(printf "%-30s" "Directory of:")${CMSG}${vhostdir}${CEND}"
   [ "${rewrite_flag}" == 'y' -a "${rewrite}" != 'magento2' -a "${rewrite}" != 'pathinfo' ] && echo "$(printf "%-30s" "Rewrite rule:")${CMSG}${web_install_dir}/conf/rewrite/${rewrite}.conf${CEND}"
-  Print_ssl
+  Print_SSL
 }
 
 Apache_log() {
@@ -823,10 +823,10 @@ EOF
   echo "$(printf "%-30s" "Your domain:")${CMSG}${domain}${CEND}"
   echo "$(printf "%-30s" "Virtualhost conf:")${CMSG}${apache_install_dir}/conf/vhost/${domain}.conf${CEND}"
   echo "$(printf "%-30s" "Directory of:")${CMSG}${vhostdir}${CEND}"
-  Print_ssl
+  Print_SSL
 }
 
-Create_nginx_apache_mod-php_conf() {
+Create_nginx_apache_modphp_conf() {
   # Nginx/Tengine/OpenResty
   [ ! -d ${web_install_dir}/conf/vhost ] && mkdir ${web_install_dir}/conf/vhost
   cat > ${web_install_dir}/conf/vhost/${domain}.conf << EOF
@@ -924,12 +924,12 @@ EOF
   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}"
-  Print_ssl
+  Print_SSL
 }
 
 Add_Vhost() {
   if [ -e "${web_install_dir}/sbin/nginx" -a ! -e "${apache_install_dir}/bin/httpd" ]; then
-    Choose_env
+    Choose_ENV
     Input_Add_domain
     Nginx_anti_hotlinking
     if [ "${NGX_FLAG}" == "java" ]; then
@@ -938,19 +938,19 @@ Add_Vhost() {
     else
       Nginx_rewrite
       Nginx_log
-      Create_nginx_php-fpm_hhvm_conf
+      Create_nginx_phpfpm_hhvm_conf
     fi
   elif [ ! -e "${web_install_dir}/sbin/nginx" -a -e "${apache_install_dir}/bin/httpd" ]; then
-    Choose_env
+    Choose_ENV
     Input_Add_domain
     Apache_log
     Create_apache_conf
   elif [ ! -e "${web_install_dir}/sbin/nginx" -a ! -e "${apache_install_dir}/bin/httpd" -a -e "${tomcat_install_dir}/conf/server.xml" ]; then
-    Choose_env
+    Choose_ENV
     Input_Add_domain
     Create_tomcat_conf
   elif [ -e "${web_install_dir}/sbin/nginx" -a -e "${apache_install_dir}/bin/httpd" ]; then
-    Choose_env
+    Choose_ENV
     Input_Add_domain
     Nginx_anti_hotlinking
     if [ "${NGX_FLAG}" == "java" ]; then
@@ -959,11 +959,11 @@ Add_Vhost() {
     elif [ "${NGX_FLAG}" == "hhvm" ]; then
       Nginx_rewrite
       Nginx_log
-      Create_nginx_php-fpm_hhvm_conf
+      Create_nginx_phpfpm_hhvm_conf
     elif [ "${NGX_FLAG}" == "php" ]; then
       Nginx_log
       Apache_log
-      Create_nginx_apache_mod-php_conf
+      Create_nginx_apache_modphp_conf
     fi
   else
     echo "Error! ${CFAILURE}Web server${CEND} not found!"