Browse Source

improve shell read -e -p

lj2007331@gmail.com 6 years ago
parent
commit
b490a32478
10 changed files with 113 additions and 113 deletions
  1. 8 8
      addons.sh
  2. 27 27
      backup_setup.sh
  3. 35 35
      install.sh
  4. 4 4
      pureftpd_vhost.sh
  5. 1 1
      reset_db_root_password.sh
  6. 4 4
      ss.sh
  7. 2 2
      uninstall.sh
  8. 1 1
      upgrade.sh
  9. 2 2
      versions.txt
  10. 29 29
      vhost.sh

+ 8 - 8
addons.sh

@@ -154,7 +154,7 @@ ACTION_FUN() {
     echo "Please select an action:"
     echo -e "\t${CMSG}1${CEND}. install"
     echo -e "\t${CMSG}2${CEND}. uninstall"
-    read -p "Please input a number:(Default 1 press Enter) " ACTION
+    read -e -p "Please input a number:(Default 1 press Enter) " ACTION
     [ -z "${ACTION}" ] && ACTION=1
     if [[ ! "${ACTION}" =~ ^[1,2]$ ]]; then
       echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -180,7 +180,7 @@ What Are You Doing?
 \t${CMSG}11${CEND}. Install/Uninstall ngx_lua_waf 
 \t${CMSG} q${CEND}. Exit
 "
-  read -p "Please input the correct option: " Number
+  read -e -p "Please input the correct option: " Number
   if [[ ! "${Number}" =~ ^[1-9,q]$|^1[0-1]$ ]]; then
     echo "${CFAILURE}input error! Please only input 1~11 and q${CEND}"
   else
@@ -193,7 +193,7 @@ What Are You Doing?
           echo -e "\t${CMSG}2${CEND}. XCache"
           echo -e "\t${CMSG}3${CEND}. APCU"
           echo -e "\t${CMSG}4${CEND}. eAccelerator"
-          read -p "Please input a number:(Default 1 press Enter) " phpcache_option
+          read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
           [ -z "${phpcache_option}" ] && phpcache_option=1
           if [[ ! "${phpcache_option}" =~ ^[1-4]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~4${CEND}"
@@ -233,7 +233,7 @@ What Are You Doing?
             2)
               if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]]; then
                 while :; do
-                  read -p "Please input xcache admin password: " xcachepwd
+                  read -e -p "Please input xcache admin password: " xcachepwd
                   (( ${#xcachepwd} >= 5 )) && { xcachepwd_md5=$(echo -n "${xcachepwd}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
                 done
                 checkDownload
@@ -272,7 +272,7 @@ What Are You Doing?
           echo "Please select ZendGuardLoader/ionCube:"
           echo -e "\t${CMSG}1${CEND}. ZendGuardLoader"
           echo -e "\t${CMSG}2${CEND}. ionCube Loader"
-          read -p "Please input a number:(Default 1 press Enter) " Loader
+          read -e -p "Please input a number:(Default 1 press Enter) " Loader
           [ -z "${Loader}" ] && Loader=1
           if [[ ! "${Loader}" =~ ^[1,2]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -311,7 +311,7 @@ What Are You Doing?
           echo "Please select ImageMagick/GraphicsMagick:"
           echo -e "\t${CMSG}1${CEND}. ImageMagick"
           echo -e "\t${CMSG}2${CEND}. GraphicsMagick"
-          read -p "Please input a number:(Default 1 press Enter) " magick_option
+          read -e -p "Please input a number:(Default 1 press Enter) " magick_option
           [ -z "${magick_option}" ] && magick_option=1
           if [[ ! "${magick_option}" =~ ^[1,2]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -345,7 +345,7 @@ What Are You Doing?
           echo "Please select fileinfo/imap:"
           echo -e "\t${CMSG}1${CEND}. fileinfo"
           echo -e "\t${CMSG}2${CEND}. imap"
-          read -p "Please input a number:(Default 1 press Enter) " phpext_option
+          read -e -p "Please input a number:(Default 1 press Enter) " phpext_option
           [ -z "${phpext_option}" ] && phpext_option=1
           if [[ ! "${phpext_option}" =~ ^[1,2]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -390,7 +390,7 @@ What Are You Doing?
           echo -e "\t${CMSG}1${CEND}. memcache PHP Extension"
           echo -e "\t${CMSG}2${CEND}. memcached PHP Extension"
           echo -e "\t${CMSG}3${CEND}. memcache/memcached PHP Extension"
-          read -p "Please input a number:(Default 1 press Enter) " Memcache
+          read -e -p "Please input a number:(Default 1 press Enter) " Memcache
           [ -z "${Memcache}" ] && Memcache=1
           if [[ ! "${Memcache}" =~ ^[1-3]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~3${CEND}"

+ 27 - 27
backup_setup.sh

@@ -38,7 +38,7 @@ while :; do echo
   echo -e "\t${CMSG}4${CEND}. Qcloud COS"
   echo -e "\t${CMSG}5${CEND}. UPYUN"
   echo -e "\t${CMSG}6${CEND}. QINIU"
-  read -p "Please input a number:(Default 1 press Enter) " desc_bk
+  read -e -p "Please input a number:(Default 1 press Enter) " desc_bk
   [ -z "${desc_bk}" ] && desc_bk=1
   ary=(1 2 3 4 5 6 12 13 14 15 16 23 24 25 26 34 35 36 45 46 56 123 124 125 126 134 135 136 145 146 156 234 235 236 245 246 256 345 346 456 1234 1235 1236 2345 2346 3456 12345 12346 13456 23456 123456)
   if [[ "${ary[@]}" =~ "${desc_bk}" ]]; then
@@ -62,7 +62,7 @@ while :; do echo
   echo -e "\t${CMSG}1${CEND}. Only Database"
   echo -e "\t${CMSG}2${CEND}. Only Website"
   echo -e "\t${CMSG}3${CEND}. Database and Website"
-  read -p "Please input a number:(Default 1 press Enter) " content_bk
+  read -e -p "Please input a number:(Default 1 press Enter) " content_bk
   [ -z "${content_bk}" ] && content_bk=1
   if [[ ! ${content_bk} =~ ^[1-3]$ ]]; then
     echo "${CWARNING}input error! Please only input number 1~3${CEND}"
@@ -78,7 +78,7 @@ done
 if [[ ${desc_bk} =~ ^[1,2]$ ]]; then
   while :; do echo
     echo "Please enter the directory for save the backup file: "
-    read -p "(Default directory: ${backup_dir}): " new_backup_dir
+    read -e -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}"
@@ -91,7 +91,7 @@ fi
 
 while :; do echo
   echo "Please enter a valid backup number of days: "
-  read -p "(Default days: 5): " expired_days
+  read -e -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
@@ -101,7 +101,7 @@ if [ "${content_bk}" != '2' ]; then
   databases=`${db_install_dir}/bin/mysql -uroot -p$dbrootpwd -e "show databases\G" | grep Database | awk '{print $2}' | grep -Evw "(performance_schema|information_schema|mysql|sys)"`
   while :; do echo
     echo "Please enter one or more name for database, separate multiple database names with commas: "
-    read -p "(Default database: `echo $databases | tr ' ' ','`) " db_name
+    read -e -p "(Default database: `echo $databases | tr ' ' ','`) " db_name
     db_name=`echo ${db_name} | tr -d ' '`
     [ -z "${db_name}" ] && db_name="`echo $databases | tr ' ' ','`"
     D_tmp=0
@@ -118,7 +118,7 @@ if [ "${content_bk}" != '1' ]; then
   websites=`ls ${wwwroot_dir}`
   while :; 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 -e -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
@@ -139,16 +139,16 @@ echo "You have to backup the content:"
 if [ `echo ${desc_bk} | grep -e 2` ]; then
   > tools/iplist.txt
   while :; do echo
-    read -p "Please enter the remote host ip: " remote_ip
+    read -e -p "Please enter the remote host ip: " remote_ip
     [ -z "${remote_ip}" -o "${remote_ip}" == '127.0.0.1' ] && continue
     echo
-    read -p "Please enter the remote host port(Default: 22) : " remote_port
+    read -e -p "Please enter the remote host port(Default: 22) : " remote_port
     [ -z "${remote_port}" ] && remote_port=22
     echo
-    read -p "Please enter the remote host user(Default: root) : " remote_user
+    read -e -p "Please enter the remote host user(Default: root) : " remote_user
     [ -z "${remote_user}" ] && remote_user=root
     echo
-    read -p "Please enter the remote host password: " remote_password
+    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')
     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')
@@ -157,7 +157,7 @@ if [ `echo ${desc_bk} | grep -e 2` ]; then
     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}"
       while :; do
-        read -p "Do you want to add more host ? [y/n]: " morehost_yn
+        read -e -p "Do you want to add more host ? [y/n]: " morehost_yn
         if [[ ! ${morehost_yn} =~ ^[y,n]$ ]]; then
           echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
         else
@@ -189,7 +189,7 @@ if [ `echo ${desc_bk} | grep -e 3` ]; then
     echo -e "\t${CMSG}13${CEND}. ap-southeast-亚太东南 3 (吉隆坡) ${CMSG}14${CEND}. ap-southeast-亚太东南 5 (雅加达)"
     echo -e "\t${CMSG}15${CEND}. ap-northeast-亚太东北 1 (日本)   ${CMSG}16${CEND}. ap-south-亚太南部 1 (孟买)"
     echo -e "\t${CMSG}17${CEND}. eu-central-欧洲中部 1 (法兰克福) ${CMSG}18${CEND}. me-east-中东东部 1 (迪拜)"
-    read -p "Please input a number:(Default 1 press Enter) " Location
+    read -e -p "Please input a number:(Default 1 press Enter) " Location
     [ -z "${Location}" ] && Location=1
     if [[ "${Location}" =~ ^[1-9]$|^1[0-8]$ ]]; then
       break
@@ -218,16 +218,16 @@ if [ `echo ${desc_bk} | grep -e 3` ]; then
   [ "$(./include/check_port.py ${Host} 80)" == "False" ] && Host=`echo ${Host} | sed 's@-internal@@g'`
   [ -e "/root/.ossutilconfig" ] && rm -f /root/.ossutilconfig
   while :; do echo
-    read -p "Please enter the aliyun oss Access Key ID: " KeyID
+    read -e -p "Please enter the aliyun oss Access Key ID: " KeyID
     [ -z "${KeyID}" ] && continue
     echo
-    read -p "Please enter the aliyun oss Access Key Secret: " KeySecret
+    read -e -p "Please enter the aliyun oss Access Key Secret: " KeySecret
     [ -z "${KeySecret}" ] && continue
     /usr/local/bin/ossutil ls -e ${Host} -i ${KeyID} -k ${KeySecret} >/dev/null 2>&1
     if [ $? -eq 0 ];then
       /usr/local/bin/ossutil config -e ${Host} -i ${KeyID} -k ${KeySecret} >/dev/null 2>&1
       while :; do echo
-        read -p "Please enter the aliyun oss bucket: " Bucket
+        read -e -p "Please enter the aliyun oss bucket: " Bucket
         /usr/local/bin/ossutil mb oss://${Bucket} >/dev/null 2>&1
         [ $? -eq 0 ] && { echo "${CMSG}[${Bucket}] createbucket OK${CEND}"; sed -i "s@^oss_bucket=.*@oss_bucket=${Bucket}@" ./options.conf; break; } || echo "${CWARNING}[${Bucket}] already exists, You need to use the OSS Console to create a bucket for storing.${CEND}"
       done
@@ -250,7 +250,7 @@ if [ `echo ${desc_bk} | grep -e 4` ]; then
     echo -e "\t ${CMSG}13${CEND}. na-siliconvalley-硅谷       ${CMSG}14${CEND}. na-ashburn-弗吉尼亚"
     echo -e "\t ${CMSG}15${CEND}. ap-bangkok-曼谷             ${CMSG}16${CEND}. eu-moscow-莫斯科"
     echo -e "\t ${CMSG}17${CEND}. ap-tokyo-东京"
-    read -p "Please input a number:(Default 1 press Enter) " Location
+    read -e -p "Please input a number:(Default 1 press Enter) " Location
     [ -z "${Location}" ] && Location=1
     if [[ "${Location}" =~ ^[1-9]$|^1[0-7]$ ]]; then
       break
@@ -276,16 +276,16 @@ if [ `echo ${desc_bk} | grep -e 4` ]; then
   [ "${Location}" == '16' ] && region='eu-moscow'
   [ "${Location}" == '17' ] && region='ap-tokyo'
   while :; do echo
-    read -p "Please enter the Qcloud COS APPID: " APPID
+    read -e -p "Please enter the Qcloud COS APPID: " APPID
     [ -z "${APPID}" ] && continue
     echo
-    read -p "Please enter the Qcloud COS SecretId: " SecretId
+    read -e -p "Please enter the Qcloud COS SecretId: " SecretId
     [ -z "${SecretId}" ] && continue
     echo
-    read -p "Please enter the Qcloud COS SecretKey: " SecretKey
+    read -e -p "Please enter the Qcloud COS SecretKey: " SecretKey
     [ -z "$SecretKey" ] && continue
     echo
-    read -p "Please enter the Qcloud COS bucket: " bucket
+    read -e -p "Please enter the Qcloud COS bucket: " bucket
     [ -z "${bucket}" ] && continue
     echo
     ${python_install_dir}/bin/coscmd config -u ${APPID} -a ${SecretId} -s $SecretKey -r $region -b ${bucket} >/dev/null 2>&1
@@ -310,13 +310,13 @@ if [ `echo ${desc_bk} | grep -e 5` ]; then
     chmod +x /usr/local/bin/upx
   fi
   while :; do echo
-    read -p "Please enter the upyun ServiceName: " ServiceName
+    read -e -p "Please enter the upyun ServiceName: " ServiceName
     [ -z "${ServiceName}" ] && continue
     echo
-    read -p "Please enter the upyun Operator: " Operator
+    read -e -p "Please enter the upyun Operator: " Operator
     [ -z "${Operator}" ] && continue
     echo
-    read -p "Please enter the upyun Password: " Password
+    read -e -p "Please enter the upyun Password: " Password
     [ -z "${Password}" ] && continue
     echo
     /usr/local/bin/upx login ${ServiceName} ${Operator} ${Password} >/dev/null 2>&1
@@ -355,7 +355,7 @@ if [ `echo ${desc_bk} | grep -e 6` ]; then
     echo -e "\t ${CMSG} 1${CEND}. 华东            ${CMSG}2${CEND}. 华北"
     echo -e "\t ${CMSG} 3${CEND}. 华南            ${CMSG}4${CEND}. 北美"
     echo -e "\t ${CMSG} 5${CEND}. 东南亚" 
-    read -p "Please input a number:(Default 1 press Enter) " Location
+    read -e -p "Please input a number:(Default 1 press Enter) " Location
     [ -z "${Location}" ] && Location=1
     if [[ "${Location}" =~ ^[1-5]$ ]]; then
       break
@@ -369,13 +369,13 @@ if [ `echo ${desc_bk} | grep -e 6` ]; then
   [ "${Location}" == '4' ] && zone='na0'
   [ "${Location}" == '5' ] && zone='as0'
   while :; do echo
-    read -p "Please enter the qiniu AccessKey: " AccessKey 
+    read -e -p "Please enter the qiniu AccessKey: " AccessKey 
     [ -z "${AccessKey}" ] && continue
     echo
-    read -p "Please enter the qiniu SecretKey: " SecretKey 
+    read -e -p "Please enter the qiniu SecretKey: " SecretKey 
     [ -z "${SecretKey}" ] && continue
     echo
-    read -p "Please enter the qiniu bucket: " bucket
+    read -e -p "Please enter the qiniu bucket: " bucket
     [ -z "${bucket}" ] && continue
     echo
     /usr/local/bin/qshell account ${AccessKey} ${SecretKey}

+ 35 - 35
install.sh

@@ -189,7 +189,7 @@ if [ -e "/etc/ssh/sshd_config" ]; then
   if [ ${ARG_NUM} == 0 ]; then
     [ -z "`grep ^Port /etc/ssh/sshd_config`" ] && now_ssh_port=22 || now_ssh_port=`grep ^Port /etc/ssh/sshd_config | awk '{print $2}'`
     while :; do echo
-      read -p "Please input SSH port(Default: ${now_ssh_port}): " ssh_port
+      read -e -p "Please input SSH port(Default: ${now_ssh_port}): " ssh_port
       [ -z "${ssh_port}" ] && ssh_port=${now_ssh_port}
       if [ ${ssh_port} -eq 22 >/dev/null 2>&1 -o ${ssh_port} -gt 1024 >/dev/null 2>&1 -a ${ssh_port} -lt 65535 >/dev/null 2>&1 ]; then
         break
@@ -209,7 +209,7 @@ fi
 if [ ${ARG_NUM} == 0 ]; then
   # check iptables
   while :; do echo
-    read -p "Do you want to enable iptables? [y/n]: " iptables_yn
+    read -e -p "Do you want to enable iptables? [y/n]: " iptables_yn
     if [[ ! ${iptables_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -219,7 +219,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check Web server
   while :; do echo
-    read -p "Do you want to install Web server? [y/n]: " web_yn
+    read -e -p "Do you want to install Web server? [y/n]: " web_yn
     if [[ ! ${web_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -231,7 +231,7 @@ if [ ${ARG_NUM} == 0 ]; then
           echo -e "\t${CMSG}2${CEND}. Install Tengine"
           echo -e "\t${CMSG}3${CEND}. Install OpenResty"
           echo -e "\t${CMSG}4${CEND}. Do not install"
-          read -p "Please input a number:(Default 1 press Enter) " nginx_option
+          read -e -p "Please input a number:(Default 1 press Enter) " nginx_option
           [ -z "${nginx_option}" ] && nginx_option=1
           if [[ ! ${nginx_option} =~ ^[1-4]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~4${CEND}"
@@ -248,7 +248,7 @@ if [ ${ARG_NUM} == 0 ]; then
           echo -e "\t${CMSG}1${CEND}. Install Apache-2.4"
           echo -e "\t${CMSG}2${CEND}. Install Apache-2.2"
           echo -e "\t${CMSG}3${CEND}. Do not install"
-          read -p "Please input a number:(Default 3 press Enter) " apache_option
+          read -e -p "Please input a number:(Default 3 press Enter) " apache_option
           [ -z "${apache_option}" ] && apache_option=3
           if [[ ! ${apache_option} =~ ^[1-3]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~3${CEND}"
@@ -265,7 +265,7 @@ if [ ${ARG_NUM} == 0 ]; then
           echo -e "\t${CMSG}3${CEND}. Install Tomcat-7"
           echo -e "\t${CMSG}4${CEND}. Install Tomcat-6"
           echo -e "\t${CMSG}5${CEND}. Do not install"
-          read -p "Please input a number:(Default 5 press Enter) " tomcat_option
+          read -e -p "Please input a number:(Default 5 press Enter) " tomcat_option
           [ -z "${tomcat_option}" ] && tomcat_option=5
           if [[ ! ${tomcat_option} =~ ^[1-5]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~5${CEND}"
@@ -276,7 +276,7 @@ if [ ${ARG_NUM} == 0 ]; then
                 echo 'Please select JDK version:'
                 echo -e "\t${CMSG}1${CEND}. Install JDK-10"
                 echo -e "\t${CMSG}2${CEND}. Install JDK-1.8"
-                read -p "Please input a number:(Default 1 press Enter) " jdk_option
+                read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
                 [ -z "${jdk_option}" ] && jdk_option=1
                 if [[ ! ${jdk_option} =~ ^[1-2]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -290,7 +290,7 @@ if [ ${ARG_NUM} == 0 ]; then
                 echo -e "\t${CMSG}1${CEND}. Install JDK-10"
                 echo -e "\t${CMSG}2${CEND}. Install JDK-1.8"
                 echo -e "\t${CMSG}3${CEND}. Install JDK-1.7"
-                read -p "Please input a number:(Default 2 press Enter) " jdk_option
+                read -e -p "Please input a number:(Default 2 press Enter) " jdk_option
                 [ -z "${jdk_option}" ] && jdk_option=2
                 if [[ ! ${jdk_option} =~ ^[1-3]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 1~3${CEND}"
@@ -304,7 +304,7 @@ if [ ${ARG_NUM} == 0 ]; then
                 echo -e "\t${CMSG}2${CEND}. Install JDK-1.8"
                 echo -e "\t${CMSG}3${CEND}. Install JDK-1.7"
                 echo -e "\t${CMSG}4${CEND}. Install JDK-1.6"
-                read -p "Please input a number:(Default 3 press Enter) " jdk_option
+                read -e -p "Please input a number:(Default 3 press Enter) " jdk_option
                 [ -z "${jdk_option}" ] && jdk_option=3
                 if [[ ! ${jdk_option} =~ ^[2-4]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 2~4${CEND}"
@@ -317,7 +317,7 @@ if [ ${ARG_NUM} == 0 ]; then
                 echo 'Please select JDK version:'
                 echo -e "\t${CMSG}3${CEND}. Install JDK-1.7"
                 echo -e "\t${CMSG}4${CEND}. Install JDK-1.6"
-                read -p "Please input a number:(Default 4 press Enter) " jdk_option
+                read -e -p "Please input a number:(Default 4 press Enter) " jdk_option
                 [ -z "${jdk_option}" ] && jdk_option=4
                 if [[ ! ${jdk_option} =~ ^[3-4]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 3~4${CEND}"
@@ -336,7 +336,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # choice database
   while :; do echo
-    read -p "Do you want to install Database? [y/n]: " db_yn
+    read -e -p "Do you want to install Database? [y/n]: " db_yn
     if [[ ! ${db_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -358,7 +358,7 @@ if [ ${ARG_NUM} == 0 ]; then
           echo -e "\t${CMSG}13${CEND}. Install AliSQL-5.6"
           echo -e "\t${CMSG}14${CEND}. Install PostgreSQL"
           echo -e "\t${CMSG}15${CEND}. Install MongoDB"
-          read -p "Please input a number:(Default 2 press Enter) " db_option
+          read -e -p "Please input a number:(Default 2 press Enter) " db_option
           [ -z "${db_option}" ] && db_option=2
           [[ "${db_option}" =~ ^5$|^15$ ]] && [ "${OS_BIT}" == '32' ] && { echo "${CWARNING}By not supporting 32-bit! ${CEND}"; continue; }
           if [[ "${db_option}" =~ ^[1-9]$|^1[0-5]$ ]]; then
@@ -371,13 +371,13 @@ if [ ${ARG_NUM} == 0 ]; then
             fi
             while :; do
               if [ "${db_option}" == '14' ]; then
-                read -p "Please input the postgres password of PostgreSQL(default: ${dbpostgrespwd}): " dbpwd
+                read -e -p "Please input the postgres password of PostgreSQL(default: ${dbpostgrespwd}): " dbpwd
                 [ -z "${dbpwd}" ] && dbpwd=${dbpostgrespwd}
               elif [ "${db_option}" == '15' ]; then
-                read -p "Please input the root password of MongoDB(default: ${dbmongopwd}): " dbpwd
+                read -e -p "Please input the root password of MongoDB(default: ${dbmongopwd}): " dbpwd
                 [ -z "${dbpwd}" ] && dbpwd=${dbmongopwd}
               else
-                read -p "Please input the root password of MySQL(default: ${dbrootpwd}): " dbpwd
+                read -e -p "Please input the root password of MySQL(default: ${dbrootpwd}): " dbpwd
                 [ -z "${dbpwd}" ] && dbpwd=${dbrootpwd}
               fi
               [ -n "`echo ${dbpwd} | grep '[+|&]'`" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and & ${CEND}"; continue; }
@@ -400,7 +400,7 @@ if [ ${ARG_NUM} == 0 ]; then
                 echo "Please choose installation of the database:"
                 echo -e "\t${CMSG}1${CEND}. Install database from binary package."
                 echo -e "\t${CMSG}2${CEND}. Install database from source package."
-                read -p "Please input a number:(Default 1 press Enter) " dbinstallmethod
+                read -e -p "Please input a number:(Default 1 press Enter) " dbinstallmethod
                 [ -z "${dbinstallmethod}" ] && dbinstallmethod=1
                 if [[ ! ${dbinstallmethod} =~ ^[1-2]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -422,7 +422,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check PHP
   while :; do echo
-    read -p "Do you want to install PHP? [y/n]: " php_yn
+    read -e -p "Do you want to install PHP? [y/n]: " php_yn
     if [[ ! ${php_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -437,13 +437,13 @@ if [ ${ARG_NUM} == 0 ]; then
           echo -e "\t${CMSG}5${CEND}. Install php-7.0"
           echo -e "\t${CMSG}6${CEND}. Install php-7.1"
           echo -e "\t${CMSG}7${CEND}. Install php-7.2"
-          read -p "Please input a number:(Default 5 press Enter) " php_option
+          read -e -p "Please input a number:(Default 5 press Enter) " php_option
           [ -z "${php_option}" ] && php_option=5
           if [[ ! ${php_option} =~ ^[1-7]$ ]]; then
             echo "${CWARNING}input error! Please only input number 1~7${CEND}"
           else
             while :; do echo
-              read -p "Do you want to install opcode cache of the PHP? [y/n]: " phpcache_yn
+              read -e -p "Do you want to install opcode cache of the PHP? [y/n]: " phpcache_yn
               if [[ ! ${phpcache_yn} =~ ^[y,n]$ ]]; then
                 echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
               else
@@ -455,7 +455,7 @@ if [ ${ARG_NUM} == 0 ]; then
                       echo -e "\t${CMSG}2${CEND}. Install XCache"
                       echo -e "\t${CMSG}3${CEND}. Install APCU"
                       echo -e "\t${CMSG}4${CEND}. Install eAccelerator-0.9"
-                      read -p "Please input a number:(Default 1 press Enter) " phpcache_option
+                      read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
                       [ -z "${phpcache_option}" ] && phpcache_option=1
                       if [[ ! ${phpcache_option} =~ ^[1-4]$ ]]; then
                         echo "${CWARNING}input error! Please only input number 1~4${CEND}"
@@ -471,7 +471,7 @@ if [ ${ARG_NUM} == 0 ]; then
                       echo -e "\t${CMSG}2${CEND}. Install XCache"
                       echo -e "\t${CMSG}3${CEND}. Install APCU"
                       echo -e "\t${CMSG}4${CEND}. Install eAccelerator-1.0-dev"
-                      read -p "Please input a number:(Default 1 press Enter) " phpcache_option
+                      read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
                       [ -z "${phpcache_option}" ] && phpcache_option=1
                       if [[ ! ${phpcache_option} =~ ^[1-4]$ ]]; then
                         echo "${CWARNING}input error! Please only input number 1~4${CEND}"
@@ -486,7 +486,7 @@ if [ ${ARG_NUM} == 0 ]; then
                       echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
                       echo -e "\t${CMSG}2${CEND}. Install XCache"
                       echo -e "\t${CMSG}3${CEND}. Install APCU"
-                      read -p "Please input a number:(Default 1 press Enter) " phpcache_option
+                      read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
                       [ -z "${phpcache_option}" ] && phpcache_option=1
                       if [[ ! ${phpcache_option} =~ ^[1-3]$ ]]; then
                         echo "${CWARNING}input error! Please only input number 1~3${CEND}"
@@ -501,7 +501,7 @@ if [ ${ARG_NUM} == 0 ]; then
                       echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
                       echo -e "\t${CMSG}2${CEND}. Install XCache"
                       echo -e "\t${CMSG}3${CEND}. Install APCU"
-                      read -p "Please input a number:(Default 1 press Enter) " phpcache_option
+                      read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
                       [ -z "${phpcache_option}" ] && phpcache_option=1
                       if [[ ! ${phpcache_option} =~ ^[1-3]$ ]]; then
                         echo "${CWARNING}input error! Please only input number 1~3${CEND}"
@@ -515,7 +515,7 @@ if [ ${ARG_NUM} == 0 ]; then
                       echo 'Please select a opcode cache of the PHP:'
                       echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
                       echo -e "\t${CMSG}3${CEND}. Install APCU"
-                      read -p "Please input a number:(Default 1 press Enter) " phpcache_option
+                      read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
                       [ -z "${phpcache_option}" ] && phpcache_option=1
                       if [[ ! ${phpcache_option} =~ ^[1,3]$ ]]; then
                         echo "${CWARNING}input error! Please only input number 1,3${CEND}"
@@ -531,13 +531,13 @@ if [ ${ARG_NUM} == 0 ]; then
             done
             if [ "${phpcache_option}" == '2' ]; then
               while :; do
-                read -p "Please input xcache admin password: " xcachepwd
+                read -e -p "Please input xcache admin password: " xcachepwd
                 (( ${#xcachepwd} >= 5 )) && { xcachepwd_md5=$(echo -n "${xcachepwd}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
               done
             fi
             if [[ ${php_option} =~ ^[1-4]$ ]] && [ "${phpcache_option}" != '1' -a "${armplatform}" != "y" ]; then
               while :; do echo
-                read -p "Do you want to install ZendGuardLoader? [y/n]: " zendguardloader_yn
+                read -e -p "Do you want to install ZendGuardLoader? [y/n]: " zendguardloader_yn
                 if [[ ! ${zendguardloader_yn} =~ ^[y,n]$ ]]; then
                   echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                 else
@@ -549,7 +549,7 @@ if [ ${ARG_NUM} == 0 ]; then
             # ionCube
             if [ "${TARGET_ARCH}" != "arm64" ]; then
               while :; do echo
-                read -p "Do you want to install ionCube? [y/n]: " ioncube_yn
+                read -e -p "Do you want to install ionCube? [y/n]: " ioncube_yn
                 if [[ ! ${ioncube_yn} =~ ^[y,n]$ ]]; then
                   echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                 else
@@ -560,7 +560,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
             # ImageMagick or GraphicsMagick
             while :; do echo
-              read -p "Do you want to install ImageMagick or GraphicsMagick? [y/n]: " magick_yn
+              read -e -p "Do you want to install ImageMagick or GraphicsMagick? [y/n]: " magick_yn
               if [[ ! ${magick_yn} =~ ^[y,n]$ ]]; then
                 echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
               else
@@ -573,7 +573,7 @@ if [ ${ARG_NUM} == 0 ]; then
                 echo 'Please select ImageMagick or GraphicsMagick:'
                 echo -e "\t${CMSG}1${CEND}. Install ImageMagick"
                 echo -e "\t${CMSG}2${CEND}. Install GraphicsMagick"
-                read -p "Please input a number:(Default 1 press Enter) " magick_option
+                read -e -p "Please input a number:(Default 1 press Enter) " magick_option
                 [ -z "${magick_option}" ] && magick_option=1
                 if [[ ! ${magick_option} =~ ^[1-2]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -592,7 +592,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check Pureftpd
   while :; do echo
-    read -p "Do you want to install Pure-FTPd? [y/n]: " ftp_yn
+    read -e -p "Do you want to install Pure-FTPd? [y/n]: " ftp_yn
     if [[ ! ${ftp_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -604,7 +604,7 @@ if [ ${ARG_NUM} == 0 ]; then
   # check phpMyAdmin
   if [[ ${php_option} =~ ^[1-7]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
-      read -p "Do you want to install phpMyAdmin? [y/n]: " phpmyadmin_yn
+      read -e -p "Do you want to install phpMyAdmin? [y/n]: " phpmyadmin_yn
       if [[ ! ${phpmyadmin_yn} =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
       else
@@ -616,7 +616,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check redis
   while :; do echo
-    read -p "Do you want to install redis? [y/n]: " redis_yn
+    read -e -p "Do you want to install redis? [y/n]: " redis_yn
     if [[ ! ${redis_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -626,7 +626,7 @@ if [ ${ARG_NUM} == 0 ]; then
 
   # check memcached
   while :; do echo
-    read -p "Do you want to install memcached? [y/n]: " memcached_yn
+    read -e -p "Do you want to install memcached? [y/n]: " memcached_yn
     if [[ ! ${memcached_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -635,7 +635,7 @@ if [ ${ARG_NUM} == 0 ]; then
   done
 
   while :; do echo
-    read -p "Do you want to install HHVM? [y/n]: " hhvm_yn
+    read -e -p "Do you want to install HHVM? [y/n]: " hhvm_yn
     if [[ ! ${hhvm_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -1030,7 +1030,7 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 if [ ${ARG_NUM} == 0 ]; then
   while :; do echo
     echo "${CMSG}Please restart the server and see if the services start up fine.${CEND}"
-    read -p "Do you want to restart OS ? [y/n]: " reboot_yn
+    read -e -p "Do you want to restart OS ? [y/n]: " reboot_yn
     if [[ ! "${reboot_yn}" =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else

+ 4 - 4
pureftpd_vhost.sh

@@ -36,7 +36,7 @@ FTP_bin=${pureftpd_install_dir}/bin/pure-pw
 
 USER() {
 while :; do echo
-  read -p "Please input a username: " User
+  read -e -p "Please input a username: " User
   if [ -z "$User" ]; then
     echo "${CWARNING}username can't be NULL! ${CEND}"
   else
@@ -47,7 +47,7 @@ done
 
 PASSWORD() {
 while :; do echo
-  read -p "Please input the password: " Password
+  read -e -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
@@ -60,7 +60,7 @@ done
 
 DIRECTORY() {
 while :; do echo
-  read -p "Please input the directory(Default directory: ${wwwroot_dir}): " Directory
+  read -e -p "Please input the directory(Default directory: ${wwwroot_dir}): " Directory
   if [ -z "$Directory" ]; then
     Directory="${wwwroot_dir}"
   fi
@@ -83,7 +83,7 @@ What Are You Doing?
 \t${CMSG}6${CEND}. ShowUser
 \t${CMSG}q${CEND}. Exit
 "
-  read -p "Please input the correct option: " Number
+  read -e -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}"
   else

+ 1 - 1
reset_db_root_password.sh

@@ -64,7 +64,7 @@ done
 
 Input_dbrootpwd() {
   while :; do echo
-    read -p "Please input the root password of database: " New_dbrootpwd
+    read -e -p "Please input the root password of database: " New_dbrootpwd
     [ -n "`echo ${New_dbrootpwd} | grep '[+|&]'`" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and &${CEND}"; continue; }
     (( ${#New_dbrootpwd} >= 5 )) && break || echo "${CWARNING}database root password least 5 characters! ${CEND}"
   done

+ 4 - 4
ss.sh

@@ -41,7 +41,7 @@ Check_SS() {
 
 AddUser_SS() {
   while :; do echo
-    read -p "Please input password for SS: " SS_password
+    read -e -p "Please input password for SS: " SS_password
     [ -n "$(echo ${SS_password} | grep '[+|&]')" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and & ${CEND}"; continue; }
     (( ${#SS_password} >= 5 )) && break || echo "${CWARNING}SS password least 5 characters! ${CEND}"
   done
@@ -61,7 +61,7 @@ Iptables_set() {
   fi
 
   while :; do echo
-    read -p "Please input SS port(Default: ${SS_Default_port}): " SS_port
+    read -e -p "Please input SS port(Default: ${SS_Default_port}): " SS_port
     [ -z "${SS_port}" ] && SS_port=${SS_Default_port}
     if [ ${SS_port} -ge 1 >/dev/null 2>&1 -a ${SS_port} -le 65535 >/dev/null 2>&1 ]; then
       [ -z "$(netstat -tpln | grep :${SS_port}$)" ] && break || echo "${CWARNING}This port is already used! ${CEND}"
@@ -91,7 +91,7 @@ Def_parameter() {
     echo "Please select SS server version:"
     echo -e "\t${CMSG}1${CEND}. Install SS-libev"
     echo -e "\t${CMSG}2${CEND}. Install SS-python"
-    read -p "Please input a number:(Default 1 press Enter) " ss_option
+    read -e -p "Please input a number:(Default 1 press Enter) " ss_option
     [ -z "${ss_option}" ] && ss_option=1
     if [[ ! "${ss_option}" =~ ^[1-2]$ ]]; then
       echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -177,7 +177,7 @@ Install_SS-libev() {
 
 Uninstall_SS() {
   while :; do echo
-    read -p "Do you want to uninstall SS? [y/n]: " SS_yn
+    read -e -p "Do you want to uninstall SS? [y/n]: " SS_yn
     if [[ ! "${SS_yn}" =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else

+ 2 - 2
uninstall.sh

@@ -46,7 +46,7 @@ ${CMSG}memcached${CEND}      --->Uninstall Memcached
 
 Uninstall_status() {
   while :; do echo
-    read -p "Do you want to uninstall? [y/n]: " uninstall_yn
+    read -e -p "Do you want to uninstall? [y/n]: " uninstall_yn
     echo
     if [[ ! ${uninstall_yn} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
@@ -243,7 +243,7 @@ What Are You Doing?
 \t${CMSG}q${CEND}. Exit
 "
   echo
-  read -p "Please input the correct option: " Number
+  read -e -p "Please input the correct option: " Number
   if [[ ! $Number =~ ^[0-9,q]$ ]]; then
     echo "${CWARNING}input error! Please only input 0~9 and q${CEND}"
   else

+ 1 - 1
upgrade.sh

@@ -71,7 +71,7 @@ What Are You Doing?
 \t${CMSG}q${CEND}. Exit
 "
     echo
-    read -p "Please input the correct option: " Upgrade_flag
+    read -e -p "Please input the correct option: " Upgrade_flag
     if [[ ! ${Upgrade_flag} =~ ^[1-8,q]$ ]]; then
       echo "${CWARNING}input error! Please only input 1~8 and q${CEND}"
     else

+ 2 - 2
versions.txt

@@ -37,7 +37,7 @@ alisql_ver=5.6.32-9
 
 pgsql_ver=10.5
 
-mongodb_ver=4.0.2
+mongodb_ver=4.0.3
 
 # JDK
 jdk10_ver=10.0.2
@@ -82,7 +82,7 @@ redis_ver=4.0.11
 redis_pecl_ver=4.1.1
 
 # Memcached
-memcached_ver=1.5.10
+memcached_ver=1.5.11
 libmemcached_ver=1.0.18
 memcached_pecl_ver=2.2.0
 memcached_pecl_php7_ver=3.0.4

+ 29 - 29
vhost.sh

@@ -47,7 +47,7 @@ Choose_env() {
       echo -e "\t${CMSG}1${CEND}. Use php"
       echo -e "\t${CMSG}2${CEND}. Use java"
       echo -e "\t${CMSG}3${CEND}. Use hhvm"
-      read -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
+      read -e -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
       [ -z "${ENV_FLAG}" ] && ENV_FLAG=1
       if [[ ! ${ENV_FLAG} =~ ^[1-3]$ ]]; then
         echo "${CWARNING}input error! Please only input number 1~3${CEND}"
@@ -72,7 +72,7 @@ Choose_env() {
       echo "Please choose to use environment:"
       echo -e "\t${CMSG}1${CEND}. Use php"
       echo -e "\t${CMSG}2${CEND}. Use java"
-      read -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
+      read -e -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
       [ -z "${ENV_FLAG}" ] && ENV_FLAG=1
       if [[ ! ${ENV_FLAG} =~ ^[1-2]$ ]]; then
         echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -91,7 +91,7 @@ Choose_env() {
       echo "Please choose to use environment:"
       echo -e "\t${CMSG}1${CEND}. Use php"
       echo -e "\t${CMSG}2${CEND}. Use hhvm"
-      read -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
+      read -e -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
       [ -z "${ENV_FLAG}" ] && ENV_FLAG=1
       if [[ ! ${ENV_FLAG} =~ ^[1-2]$ ]]; then
         echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -107,7 +107,7 @@ Choose_env() {
       echo "Please choose to use environment:"
       echo -e "\t${CMSG}1${CEND}. Use java"
       echo -e "\t${CMSG}2${CEND}. Use hhvm"
-      read -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
+      read -e -p "Please input a number:(Default 1 press Enter) " ENV_FLAG
       [ -z "${ENV_FLAG}" ] && ENV_FLAG=1
       if [[ ! ${ENV_FLAG} =~ ^[1-2]$ ]]; then
         echo "${CWARNING}input error! Please only input number 1~2${CEND}"
@@ -152,19 +152,19 @@ For some fields there will be a default value,
 If you enter '.', the field will be left blank.
 "
     echo
-    read -p "Country Name (2 letter code) [CN]: " SELFSIGNEDSSL_C
+    read -e -p "Country Name (2 letter code) [CN]: " SELFSIGNEDSSL_C
     [ -z "${SELFSIGNEDSSL_C}" ] && SELFSIGNEDSSL_C="CN"
     echo
-    read -p "State or Province Name (full name) [Shanghai]: " SELFSIGNEDSSL_ST
+    read -e -p "State or Province Name (full name) [Shanghai]: " SELFSIGNEDSSL_ST
     [ -z "${SELFSIGNEDSSL_ST}" ] && SELFSIGNEDSSL_ST="Shanghai"
     echo
-    read -p "Locality Name (eg, city) [Shanghai]: " SELFSIGNEDSSL_L
+    read -e -p "Locality Name (eg, city) [Shanghai]: " SELFSIGNEDSSL_L
     [ -z "${SELFSIGNEDSSL_L}" ] && SELFSIGNEDSSL_L="Shanghai"
     echo
-    read -p "Organization Name (eg, company) [Example Inc.]: " SELFSIGNEDSSL_O
+    read -e -p "Organization Name (eg, company) [Example Inc.]: " SELFSIGNEDSSL_O
     [ -z "${SELFSIGNEDSSL_O}" ] && SELFSIGNEDSSL_O="Example Inc."
     echo
-    read -p "Organizational Unit Name (eg, section) [IT Dept.]: " SELFSIGNEDSSL_OU
+    read -e -p "Organizational Unit Name (eg, section) [IT Dept.]: " SELFSIGNEDSSL_OU
     [ -z "${SELFSIGNEDSSL_OU}" ] && SELFSIGNEDSSL_OU="IT Dept."
 
     openssl req -new -newkey rsa:2048 -sha256 -nodes -out ${PATH_SSL}/${domain}.csr -keyout ${PATH_SSL}/${domain}.key -subj "/C=${SELFSIGNEDSSL_C}/ST=${SELFSIGNEDSSL_ST}/L=${SELFSIGNEDSSL_L}/O=${SELFSIGNEDSSL_O}/OU=${SELFSIGNEDSSL_OU}/CN=${domain}" > /dev/null 2>&1
@@ -175,7 +175,7 @@ If you enter '.', the field will be left blank.
         echo 'Please select DNS provider:'
         echo "${CMSG}dp${CEND},${CMSG}cx${CEND},${CMSG}ali${CEND},${CMSG}cf${CEND},${CMSG}aws${CEND},${CMSG}linode${CEND},${CMSG}he${CEND},${CMSG}namesilo${CEND},${CMSG}dgon${CEND},${CMSG}freedns${CEND},${CMSG}gd${CEND},${CMSG}namecom${CEND} and so on."
         echo "${CMSG}More: https://oneinstack.com/faq/letsencrypt${CEND}"
-        read -p "Please enter your DNS provider: " DNS_PRO
+        read -e -p "Please enter your DNS provider: " DNS_PRO
         if [ -e ~/.acme.sh/dnsapi/dns_${DNS_PRO}.sh ]; then
           break
         else
@@ -184,7 +184,7 @@ If you enter '.', the field will be left blank.
       done
       while :; do echo
         echo "Syntax: export Key1=Value1 ; export Key2=Value1"
-        read -p "Please enter your dnsapi parameters: " DNS_PAR
+        read -e -p "Please enter your dnsapi parameters: " DNS_PAR
         echo
         eval $DNS_PAR
         if [ $? == 0 ]; then
@@ -272,7 +272,7 @@ What Are You Doing?
 \t${CMSG}3${CEND}. Use Let's Encrypt to Create SSL Certificate and Key
 \t${CMSG}q${CEND}. Exit
 "
-      read -p "Please input the correct option: " Domian_Mode
+      read -e -p "Please input the correct option: " Domian_Mode
       if [[ ! "${Domian_Mode}" =~ ^[1-3,q]$ ]]; then
         echo "${CFAILURE}input error! Please only input 1~3 and q${CEND}"
       else
@@ -304,7 +304,7 @@ What Are You Doing?
   fi
 
   while :; do echo
-    read -p "Please input domain(example: www.example.com): " domain
+    read -e -p "Please input domain(example: www.example.com): " domain
     if [ -z "$(echo ${domain} | grep '.*\..*')" ]; then
       echo "${CWARNING}Your ${domain} is invalid! ${CEND}"
     else
@@ -323,7 +323,7 @@ What Are You Doing?
 
   while :; do echo
     echo "Please input the directory for the domain:${domain} :"
-    read -p "(Default directory: ${wwwroot_dir}/${domain}): " vhostdir
+    read -e -p "(Default directory: ${wwwroot_dir}/${domain}): " vhostdir
     if [ -n "${vhostdir}" -a -z "$(echo ${vhostdir} | grep '^/')" ]; then
       echo "${CWARNING}input error! Press Enter to continue...${CEND}"
     else
@@ -341,7 +341,7 @@ What Are You Doing?
   done
 
   while :; do echo
-    read -p "Do you want to add more domain name? [y/n]: " moredomainame_flag
+    read -e -p "Do you want to add more domain name? [y/n]: " moredomainame_flag
     if [[ ! ${moredomainame_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -351,7 +351,7 @@ What Are You Doing?
 
   if [ "${moredomainame_flag}" == 'y' ]; then
     while :; do echo
-      read -p "Type domainname or IP(example: example.com other.example.com): " moredomain
+      read -e -p "Type domainname or IP(example: example.com other.example.com): " moredomain
       if [ -z "$(echo ${moredomain} | grep '.*\..*')" ]; then
         echo "${CWARNING}Your ${domain} is invalid! ${CEND}"
       else
@@ -366,7 +366,7 @@ What Are You Doing?
 
     if [ -e "${web_install_dir}/sbin/nginx" ]; then
       while :; do echo
-        read -p "Do you want to redirect from ${moredomain} to ${domain}? [y/n]: " redirect_flag
+        read -e -p "Do you want to redirect from ${moredomain} to ${domain}? [y/n]: " redirect_flag
         if [[ ! ${redirect_flag} =~ ^[y,n]$ ]]; then
           echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
         else
@@ -379,7 +379,7 @@ What Are You Doing?
 
   if [ "${nginx_ssl_flag}" == 'y' ]; then
     while :; do echo
-      read -p "Do you want to redirect all HTTP requests to HTTPS? [y/n]: " https_flag
+      read -e -p "Do you want to redirect all HTTP requests to HTTPS? [y/n]: " https_flag
       if [[ ! ${https_flag} =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
       else
@@ -407,7 +407,7 @@ What Are You Doing?
 
 Nginx_anti_hotlinking() {
   while :; do echo
-    read -p "Do you want to add hotlink protection? [y/n]: " anti_hotlinking_flag
+    read -e -p "Do you want to add hotlink protection? [y/n]: " anti_hotlinking_flag
     if [[ ! ${anti_hotlinking_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -437,7 +437,7 @@ Nginx_anti_hotlinking() {
 Nginx_rewrite() {
   [ ! -d "${web_install_dir}/conf/rewrite" ] && mkdir ${web_install_dir}/conf/rewrite
   while :; do echo
-    read -p "Allow Rewrite rule? [y/n]: " rewrite_flag
+    read -e -p "Allow Rewrite rule? [y/n]: " rewrite_flag
     if [[ ! "${rewrite_flag}" =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -451,7 +451,7 @@ Nginx_rewrite() {
     echo
     echo "Please input the rewrite of programme :"
     echo "${CMSG}wordpress${CEND},${CMSG}opencart${CEND},${CMSG}magento2${CEND},${CMSG}drupal${CEND},${CMSG}joomla${CEND},${CMSG}laravel${CEND},${CMSG}thinkphp${CEND},${CMSG}pathinfo${CEND},${CMSG}discuz${CEND},${CMSG}typecho${CEND},${CMSG}ecshop${CEND},${CMSG}nextcloud${CEND} rewrite was exist."
-    read -p "(Default rewrite: other): " rewrite
+    read -e -p "(Default rewrite: other): " rewrite
     if [ "${rewrite}" == "" ]; then
       rewrite="other"
     fi
@@ -471,7 +471,7 @@ Nginx_rewrite() {
 
 Nginx_log() {
 while :; do echo
-    read -p "Allow Nginx/Tengine/OpenResty access_log? [y/n]: " access_flag
+    read -e -p "Allow Nginx/Tengine/OpenResty access_log? [y/n]: " access_flag
     if [[ ! "${access_flag}" =~ ^[y,n]$ ]]; then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -672,7 +672,7 @@ EOF
 
 Apache_log() {
   while :; do echo
-    read -p "Allow Apache access_log? [y/n]: " access_flag
+    read -e -p "Allow Apache access_log? [y/n]: " access_flag
     if [[ ! "${access_flag}" =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
@@ -902,7 +902,7 @@ Del_NGX_Vhost() {
       echo "Virtualhost list:"
       echo ${CMSG}${Domain_List}${CEND}
         while :; do echo
-          read -p "Please input a domain you want to delete: " domain
+          read -e -p "Please input a domain you want to delete: " domain
           if [ -z "$(echo ${domain} | grep '.*\..*')" ]; then
             echo "${CWARNING}Your ${domain} is invalid! ${CEND}"
           else
@@ -911,7 +911,7 @@ Del_NGX_Vhost() {
               rm -rf ${web_install_dir}/conf/vhost/${domain}.conf
               ${web_install_dir}/sbin/nginx -s reload
               while :; do echo
-                read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_flag
+                read -e -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_flag
                 if [[ ! ${Del_Vhost_wwwroot_flag} =~ ^[y,n]$ ]]; then
                   echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                 else
@@ -950,7 +950,7 @@ Del_Apache_Vhost() {
         echo "Virtualhost list:"
         echo ${CMSG}${Domain_List}${CEND}
         while :; do echo
-          read -p "Please input a domain you want to delete: " domain
+          read -e -p "Please input a domain you want to delete: " domain
           if [ -z "$(echo ${domain} | grep '.*\..*')" ]; then
             echo "${CWARNING}Your ${domain} is invalid! ${CEND}"
           else
@@ -959,7 +959,7 @@ Del_Apache_Vhost() {
               rm -rf ${apache_install_dir}/conf/vhost/${domain}.conf
               /etc/init.d/httpd restart
               while :; do echo
-                read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_flag
+                read -e -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_flag
                 if [[ ! ${Del_Vhost_wwwroot_flag} =~ ^[y,n]$ ]]; then
                   echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                 else
@@ -1002,7 +1002,7 @@ Del_Tomcat_Vhost() {
         echo "Virtualhost list:"
         echo ${CMSG}${Domain_List}${CEND}
         while :; do echo
-          read -p "Please input a domain you want to delete: " domain
+          read -e -p "Please input a domain you want to delete: " domain
           if [ -z "$(echo ${domain} | grep '.*\..*')" ]; then
             echo "${CWARNING}Your ${domain} is invalid! ${CEND}"
           else
@@ -1011,7 +1011,7 @@ Del_Tomcat_Vhost() {
               rm -rf ${tomcat_install_dir}/conf/vhost/${domain}.xml
               /etc/init.d/tomcat restart
               while :; do echo
-                read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_flag
+                read -e -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Vhost_wwwroot_flag
                 if [[ ! ${Del_Vhost_wwwroot_flag} =~ ^[y,n]$ ]]; then
                   echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
                 else