Browse Source

Add PostgreSQL

lj2007331@gmail.com 7 years ago
parent
commit
86a0d5dfc2
10 changed files with 180 additions and 23 deletions
  1. 1 0
      README.md
  2. 1 1
      config/index.html
  3. 27 0
      include/check_download.sh
  4. 30 0
      include/pecl_pgsql.sh
  5. 52 0
      include/postgresql.sh
  6. 1 1
      include/upgrade_php.sh
  7. 34 9
      install.sh
  8. 6 1
      options.conf
  9. 25 10
      uninstall.sh
  10. 3 1
      versions.txt

+ 1 - 0
README.md

@@ -135,4 +135,5 @@ service memcached {start|stop|status|restart|reload}
 ## Installation
 
 For feedback, questions, and to follow the progress of the project (Chinese): <br />
+[Telegram Group](https://t.me/oneinstack)<br />
 [OneinStack](https://oneinstack.com)<br />

+ 1 - 1
config/index.html

@@ -27,7 +27,7 @@ font-family:"Microsoft YaHei",sans-serif;
 <p><b>Create Web virtual running script:</b>&nbsp;&nbsp;<font color="#008000">./vhost.sh</font></p>
 <p><b>Create FTP virtual running script:</b>&nbsp;&nbsp;<font color="#008000">./pureftpd_vhost.sh</font></p>
 <p><b>For feedback, questions, and to follow the progress of the project:&nbsp;&nbsp;</b> <a target="_blank" class="links" href="https://oneinstack.com">https://oneinstack.com</a></p>
-<p><b>Author email:&nbsp;&nbsp;</b><a class="email" href="mailto:lj2007331@gmail.com">lj2007331@gmail.com</a></p>
+<p><b>Telegram Group:&nbsp;&nbsp;</b> <a target="_blank" class="links" href="https://t.me/oneinstack">t.me/oneinstack</a></p>
 <p><b>Donate:</b>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://paypal.me/yeho" target="_blank"><img src="https://img.shields.io/badge/Paypal-donate-green.svg" alt="" /></a> <a href="https://static.oneinstack.com/images/alipay.png" target="_blank"><img src="https://img.shields.io/badge/Alipay-donate-green.svg" alt="" /></a> <a href="https://static.oneinstack.com/images/weixin.png" target="_blank"><img src="https://img.shields.io/badge/Wechat-donate-green.svg" /></a></p>
 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Paypal:&nbsp;&nbsp;lj2007331@gmail.com &nbsp;&nbsp;Alipay:&nbsp;&nbsp;lj2007331@gmail.com</p>
 <div align="center"><iframe src="https://static.oneinstack.com/ad_buttom.html" width="475" frameborder="0" scrolling="no"></iframe></div>

+ 27 - 0
include/check_download.sh

@@ -521,6 +521,33 @@ checkDownload() {
           [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${ALISQL_TAR_MD5}" ] && break || continue
         done
         ;;
+
+      12) 
+        # PostgreSQL 
+        echo "Download PostgreSQL source package..."
+        FILE_NAME=postgresql-${pgsql_version}.tar.gz
+        if [ "${IPADDR_COUNTRY}"x == "CN"x ]; then
+          DOWN_ADDR_PGSQL=https://mirrors.tuna.tsinghua.edu.cn/postgresql/source/v${pgsql_version}
+          PGSQL_TAR_MD5=$(curl -Lk ${DOWN_ADDR_PGSQL}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
+          [ -z "${PGSQL_TAR_MD5}" ] && { DOWN_ADDR_PGSQL=https://mirrors.ustc.edu.cn/postgresql/source/vv${pgsql_version}; PGSQL_TAR_MD5=$(curl -Lk ${DOWN_ADDR_PGSQL}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}'); }
+        else
+          DOWN_ADDR_PGSQL=https://ftp.postgresql.org/pub/source/v${pgsql_version}
+          PGSQL_TAR_MD5=$(curl -Lk ${DOWN_ADDR_PGSQL}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
+        fi
+
+        tryDlCount=0
+        while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${PGSQL_TAR_MD5}" ]; do
+          wget -c --no-check-certificate ${DOWN_ADDR_PGSQL}/${FILE_NAME};sleep 1
+          let "tryDlCount++"
+          [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PGSQL_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
+        done
+        if [ "${tryDlCount}" == '6' ]; then
+          echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
+          kill -9 $$
+        else
+          echo "[${CMSG}${FILE_NAME}${CEND}] found."
+        fi
+        ;;
     esac
   fi
   # PHP

+ 30 - 0
include/pecl_pgsql.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://blog.linuxeye.com
+#
+# Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/lj2007331/oneinstack
+
+Install_pecl-pgsql() {
+  pushd ${oneinstack_dir}/src
+  phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
+  PHP_detail_version=$(${php_install_dir}/bin/php -r 'echo PHP_VERSION;')
+  tar xzf php-${PHP_detail_version}.tar.gz
+  pushd php-${PHP_detail_version}/ext/pgsql
+  ${php_install_dir}/bin/phpize
+  ./configure --with-pgsql=${pgsql_install_dir} --with-php-config=${php_install_dir}/bin/php-config
+  make -j ${THREAD} && make install
+  popd
+  if [ -f "${phpExtensionDir}/pgsql.so" ]; then
+    echo 'extension=pgsql.so' > ${php_install_dir}/etc/php.d/ext-pgsql.ini
+    echo "${CSUCCESS}PHP pgsql module installed successfully! ${CEND}"
+    popd
+    rm -rf php-${PHP_detail_version} 
+  else
+    echo "${CFAILURE}PHP pgsql module install failed, Please contact the author! ${CEND}"
+  fi
+  popd
+}

+ 52 - 0
include/postgresql.sh

@@ -0,0 +1,52 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://blog.linuxeye.com
+#
+# Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/lj2007331/oneinstack
+
+Install_PostgreSQL() {
+  pushd ${oneinstack_dir}/src
+  id -u postgres >/dev/null 2>&1
+  [ $? -ne 0 ] && useradd -d ${pgsql_install_dir} -s /bin/bash postgres 
+  mkdir -p ${pgsql_data_dir};chown postgres.postgres -R ${pgsql_data_dir}
+  tar xzf postgresql-${pgsql_version}.tar.gz
+  pushd postgresql-${pgsql_version}
+  ./configure --prefix=$pgsql_install_dir
+  make -j ${THREAD}
+  make install
+  chown -R postgres.postgres ${pgsql_install_dir}
+  /bin/cp ./contrib/start-scripts/linux /etc/init.d/postgresql
+  sed -i "s@^prefix=.*@prefix=${pgsql_install_dir}@" /etc/init.d/postgresql
+  sed -i "s@^PGDATA=.*@PGDATA=${pgsql_data_dir}@" /etc/init.d/postgresql
+  chmod +x /etc/init.d/postgresql
+  [ "${OS}" == "CentOS" ] && { chkconfig --add postgresql; chkconfig postgresql on; }
+  [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]] && update-rc.d postgresql defaults
+  popd
+  su - postgres -c "${pgsql_install_dir}/bin/initdb -D ${pgsql_data_dir}"
+  service postgresql start
+  sleep 5
+  su - postgres -c "${pgsql_install_dir}/bin/psql -c \"alter user postgres with password '$dbpostgrespwd';\""
+  sed -i 's@^host.*@#&@g' ${pgsql_data_dir}/pg_hba.conf
+  sed -i 's@^local.*@#&@g' ${pgsql_data_dir}/pg_hba.conf
+  echo 'local   all             all                                     md5' >> ${pgsql_data_dir}/pg_hba.conf
+  echo 'host    all             all             0.0.0.0/0               md5' >> ${pgsql_data_dir}/pg_hba.conf
+  sed -i "s@^#listen_addresses.*@listen_addresses = '*'@" ${pgsql_data_dir}/postgresql.conf
+  service postgresql reload
+
+  if [ -e "${pgsql_install_dir}/bin/psql" ]; then
+    echo "${CSUCCESS}PostgreSQL installed successfully! ${CEND}"
+    rm -rf postgresql-${pgsql_version}
+  else
+    rm -rf ${pgsql_install_dir} ${pgsql_data_dir} postgresql-${pgsql_version}
+    echo "${CFAILURE}PostgreSQL install failed, Please contact the author! ${CEND}"
+    kill -9 $$
+  fi
+  popd
+  [ -z "$(grep ^'export PATH=' /etc/profile)" ] && echo "export PATH=${pgsql_install_dir}/bin:\$PATH" >> /etc/profile
+  [ -n "$(grep ^'export PATH=' /etc/profile)" -a -z "$(grep ${pgsql_install_dir} /etc/profile)" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${pgsql_install_dir}/bin:\1@" /etc/profile
+  . /etc/profile
+}

+ 1 - 1
include/upgrade_php.sh

@@ -13,8 +13,8 @@ Upgrade_PHP() {
   [ ! -e "${php_install_dir}" ] && echo "${CWARNING}PHP is not installed on your system! ${CEND}" && exit 1
   OLD_PHP_version=`${php_install_dir}/bin/php -r 'echo PHP_VERSION;'`
   Latest_PHP_version=`curl -s http://php.net/downloads.php | awk '/Changelog/{print $2}' | grep "${OLD_PHP_version%.*}"`
-  echo
   [ -z "$Latest_PHP_version" ] && Latest_PHP_version=5.5.38
+  echo
   echo "Current PHP Version: ${CMSG}$OLD_PHP_version${CEND}"
   while :; do echo
     read -p "Please input upgrade PHP Version(Default: $Latest_PHP_version): " NEW_PHP_version

+ 34 - 9
install.sh

@@ -173,7 +173,7 @@ while :; do echo
     echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
   else
     if [ "$DB_yn" == 'y' ]; then
-      [ -d "$db_install_dir/support-files" ] && { echo "${CWARNING}Database already installed! ${CEND}"; DB_yn=Other; break; }
+      [ -d "$db_install_dir/support-files" -a -e "${pgsql_install_dir}/bin/psql" ] && { echo "${CWARNING}Database already installed! ${CEND}"; DB_yn=Other; break; }
       while :; do echo
         echo 'Please select a version of the Database:'
         echo -e "\t${CMSG} 1${CEND}. Install MySQL-5.7"
@@ -187,13 +187,24 @@ while :; do echo
         echo -e "\t${CMSG} 9${CEND}. Install Percona-5.6"
         echo -e "\t${CMSG}10${CEND}. Install Percona-5.5"
         echo -e "\t${CMSG}11${CEND}. Install AliSQL-5.6"
+        echo -e "\t${CMSG}12${CEND}. Install PostgreSQL"
         read -p "Please input a number:(Default 2 press Enter) " DB_version
         [ -z "$DB_version" ] && DB_version=2
-        if [ ${DB_version} -ge 1 >/dev/null 2>&1 -a ${DB_version} -le 11 >/dev/null 2>&1 ]; then
+        if [ ${DB_version} -ge 1 >/dev/null 2>&1 -a ${DB_version} -le 12 >/dev/null 2>&1 ]; then
           while :; do
-            read -p "Please input the root password of database: " dbrootpwd
+            if [ "$DB_version" == '12' ]; then
+              read -p "Please input the postgres password of database: " dbrootpwd
+            else
+              read -p "Please input the root password of database: " dbrootpwd
+            fi
             [ -n "`echo $dbrootpwd | grep '[+|&]'`" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and & ${CEND}"; continue; }
-            (( ${#dbrootpwd} >= 5 )) && sed -i "s+^dbrootpwd.*+dbrootpwd='$dbrootpwd'+" ./options.conf && break || echo "${CWARNING}database root password least 5 characters! ${CEND}"
+            if (( ${#dbrootpwd} >= 5 )); then
+              [ "$DB_version" == '12' ] && { sed -i "s+^dbpostgrespwd.*+dbpostgrespwd='$dbrootpwd'+" ./options.conf; dbpostgrespwd="$dbrootpwd"; } || sed -i "s+^dbrootpwd.*+dbrootpwd='$dbrootpwd'+" ./options.conf
+              break
+            else
+              echo "${CWARNING}password least 5 characters! ${CEND}"
+            fi
+
           done
           # choose install methods
           if [ ${DB_version} -ge 1 >/dev/null 2>&1 -a ${DB_version} -le 10 >/dev/null 2>&1 ]; then
@@ -212,7 +223,7 @@ while :; do echo
           fi
           break
         else
-          echo "${CWARNING}input error! Please only input number 1~11${CEND}"
+          echo "${CWARNING}input error! Please only input number 1~12${CEND}"
         fi
       done
     fi
@@ -578,6 +589,10 @@ case "${DB_version}" in
     . include/alisql-5.6.sh
     Install_AliSQL56 2>&1 | tee -a $oneinstack_dir/install.log
     ;;
+  12)
+    . include/postgresql.sh
+    Install_PostgreSQL 2>&1 | tee -a $oneinstack_dir/install.log
+    ;;
 esac
 
 # Apache
@@ -668,6 +683,12 @@ if [ "$ZendGuardLoader_yn" == 'y' ]; then
   Install_ZendGuardLoader 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
+# pecl_pgsql
+if [ "$DB_version" == '12' ] && [ -e "${php_install_dir}/bin/phpize" ]; then
+  . include/pecl_pgsql.sh
+  Install_pecl-pgsql 2>&1 | tee -a $oneinstack_dir/install.log
+fi
+
 # Web server
 case "${Nginx_version}" in
   1)
@@ -768,10 +789,14 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${Web_yn}" == 'y' -a "${Nginx_version}" != '4' -a "${Apache_version}" != '3' ] && echo -e "\n$(printf "%-32s" "Nginx install dir":)${CMSG}${web_install_dir}${CEND}\n$(printf "%-32s" "Apache install  dir":)${CMSG}${apache_install_dir}${CEND}"
 [ "${Web_yn}" == 'y' -a "${Nginx_version}" == '4' -a "${Apache_version}" != '3' ] && echo -e "\n$(printf "%-32s" "Apache install dir":)${CMSG}${apache_install_dir}${CEND}"
 [[ "${Tomcat_version}" =~ ^[1,2]$ ]] && echo -e "\n$(printf "%-32s" "Tomcat install dir":)${CMSG}${tomcat_install_dir}${CEND}"
-[ "${DB_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "Database install dir:")${CMSG}${db_install_dir}${CEND}"
-[ "${DB_yn}" == 'y' ] && echo "$(printf "%-32s" "Database data dir:")${CMSG}${db_data_dir}${CEND}"
-[ "${DB_yn}" == 'y' ] && echo "$(printf "%-32s" "Database user:")${CMSG}root${CEND}"
-[ "${DB_yn}" == 'y' ] && echo "$(printf "%-32s" "Database password:")${CMSG}${dbrootpwd}${CEND}"
+[[ "${DB_version}" =~ ^[1-9]$|^1[0-1]$ ]] && echo -e "\n$(printf "%-32s" "Database install dir:")${CMSG}${db_install_dir}${CEND}"
+[[ "${DB_version}" =~ ^[1-9]$|^1[0-1]$ ]] && echo "$(printf "%-32s" "Database data dir:")${CMSG}${db_data_dir}${CEND}"
+[[ "${DB_version}" =~ ^[1-9]$|^1[0-1]$ ]] && echo "$(printf "%-32s" "Database user:")${CMSG}root${CEND}"
+[[ "${DB_version}" =~ ^[1-9]$|^1[0-1]$ ]] && echo "$(printf "%-32s" "Database password:")${CMSG}${dbrootpwd}${CEND}"
+[ "${DB_version}" == '12' ] && echo -e "\n$(printf "%-32s" "PostgreSQL install dir:")${CMSG}${pgsql_install_dir}${CEND}"
+[ "${DB_version}" == '12' ] && echo "$(printf "%-32s" "PostgreSQL data dir:")${CMSG}${pgsql_data_dir}${CEND}"
+[ "${DB_version}" == '12' ] && echo "$(printf "%-32s" "PostgreSQL user:")${CMSG}postgres${CEND}"
+[ "${DB_version}" == '12' ] && echo "$(printf "%-32s" "postgres password:")${CMSG}${dbpostgrespwd}${CEND}"
 [ "${PHP_yn}" == 'y' ] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
 [ "${PHP_cache}" == '1' ] && echo "$(printf "%-32s" "Opcache Control Panel url:")${CMSG}http://${IPADDR}/ocp.php${CEND}"
 [ "${PHP_cache}" == '2' ] && echo "$(printf "%-32s" "xcache Control Panel url:")${CMSG}http://${IPADDR}/xcache${CEND}"

+ 6 - 1
options.conf

@@ -15,6 +15,7 @@ mysql_install_dir=/usr/local/mysql
 mariadb_install_dir=/usr/local/mariadb
 percona_install_dir=/usr/local/percona
 alisql_install_dir=/usr/local/alisql
+pgsql_install_dir=/usr/local/pgsql
 
 php_install_dir=/usr/local/php
 
@@ -38,6 +39,7 @@ mysql_data_dir=/data/mysql
 mariadb_data_dir=/data/mariadb
 percona_data_dir=/data/percona
 alisql_data_dir=/data/alisql
+pgsql_data_dir=/data/pgsql
 
 # web directory, you can customize
 wwwroot_dir=/data/wwwroot
@@ -46,9 +48,12 @@ wwwroot_dir=/data/wwwroot
 wwwlogs_dir=/data/wwwlogs
 
 #########################################################################
-# automatically generated, You can't change
+# [MySQL/MariaDB/Percona] automatically generated, You can't change
 dbrootpwd=
 
+# [PostgreSQL] automatically generated, You can't change
+dbpostgrespwd=
+
 #########################################################################
 # Backup Dest directory, change this if you have someother location
 backup_dir=/data/backup

+ 25 - 10
uninstall.sh

@@ -32,7 +32,7 @@ Usage(){
 Usage: $0 [  ${CMSG}all${CEND} | ${CMSG}web${CEND} | ${CMSG}db${CEND} | ${CMSG}php${CEND} | ${CMSG}hhvm${CEND} | ${CMSG}pureftpd${CEND} | ${CMSG}redis${CEND} | ${CMSG}memcached${CEND} ]
 ${CMSG}all${CEND}            --->Uninstall All
 ${CMSG}web${CEND}            --->Uninstall Nginx/Tengine/Apache/Tomcat
-${CMSG}db${CEND}             --->Uninstall MySQL/MariaDB/Percona/AliSQL
+${CMSG}db${CEND}             --->Uninstall MySQL/MariaDB/Percona/AliSQL/PostgreSQL
 ${CMSG}php${CEND}            --->Uninstall PHP
 ${CMSG}hhvm${CEND}           --->Uninstall HHVM
 ${CMSG}pureftpd${CEND}       --->Uninstall PureFtpd
@@ -95,15 +95,30 @@ Print_DB() {
   [ -e "${db_install_dir}" ] && echo "${db_install_dir}"
   [ -e "/etc/init.d/mysqld" ] && echo "/etc/init.d/mysqld"
   [ -e "/etc/my.cnf" ] && echo "/etc/my.cnf"
+  [ -e "${pgsql_install_dir}" ] && echo "${pgsql_install_dir}"
+  [ -e "/etc/init.d/postgresql" ] && echo "/etc/init.d/postgresql"
 }
 
 Uninstall_DB() {
-  [ -e "${db_install_dir}" ] && { service mysqld stop > /dev/null 2>&1; rm -rf ${db_install_dir} /etc/init.d/mysqld /etc/my.cnf /etc/ld.so.conf.d/{mysql,mariadb,percona,alisql}*.conf; }
-  id -u mysql >/dev/null 2>&1 ; [ $? -eq 0 ] && userdel mysql
-  [ -e "${db_data_dir}" ] && /bin/mv ${db_data_dir}{,$(date +%Y%m%d%H)}
-  sed -i 's@^dbrootpwd=.*@dbrootpwd=@' ./options.conf
-  sed -i "s@${db_install_dir}/bin:@@" /etc/profile
-  echo "${CMSG}DB uninstall completed${CEND}"
+  # uninstall mysql,mariadb,percona,alisql 
+  if [ -d "${db_install_dir}/support-files" ];then
+    service mysqld stop > /dev/null 2>&1
+    rm -rf ${db_install_dir} /etc/init.d/mysqld /etc/my.cnf /etc/ld.so.conf.d/{mysql,mariadb,percona,alisql}*.conf
+    id -u mysql >/dev/null 2>&1 ; [ $? -eq 0 ] && userdel mysql
+    [ -e "${db_data_dir}" ] && /bin/mv ${db_data_dir}{,$(date +%Y%m%d%H)}
+    sed -i 's@^dbrootpwd=.*@dbrootpwd=@' ./options.conf
+    sed -i "s@${db_install_dir}/bin:@@" /etc/profile
+  fi
+  # uninstall postgresql
+  if [ -e "${pgsql_install_dir}/bin/psql" ]; then
+    service postgresql stop > /dev/null 2>&1
+    rm -rf ${pgsql_install_dir} /etc/init.d/postgresql
+    id -u postgres >/dev/null 2>&1 ; [ $? -eq 0 ] && userdel postgres 
+    [ -e "${pgsql_data_dir}" ] && /bin/mv ${pgsql_data_dir}{,$(date +%Y%m%d%H)}
+    sed -i 's@^dbpostgrespwd=.*@dbpostgrespwd=@' ./options.conf
+    sed -i "s@${pgsql_install_dir}/bin:@@" /etc/profile
+    echo "${CMSG}PostgreSQL uninstall completed${CEND}"
+  fi
 }
 
 Print_PHP() {
@@ -177,7 +192,7 @@ Print_curlopenssl() {
 
 Uninstall_curlopenssl() {
   [ -e "/usr/local/bin/curl" ] && rm -rf /usr/local/lib/libcurl* /usr/local/bin/curl
-  [ -d "${openssl_install_dir}" ] && { rm -rf ${openssl_install_dir} /etc/ld.so.conf.d/openssl.conf; ldconfig; }
+  [ -d "${openssl_install_dir}" ] && { rm -rf ${openssl_install_dir} /etc/ld.so.conf.d/z.openssl.conf; ldconfig; }
 }
 
 Menu(){
@@ -186,7 +201,7 @@ while :; do
 What Are You Doing?
 \t${CMSG}0${CEND}. Uninstall All
 \t${CMSG}1${CEND}. Uninstall Nginx/Tengine/Apache/Tomcat
-\t${CMSG}2${CEND}. Uninstall MySQL/MariaDB/Percona/AliSQL
+\t${CMSG}2${CEND}. Uninstall MySQL/MariaDB/Percona/AliSQL/PostgreSQL
 \t${CMSG}3${CEND}. Uninstall PHP
 \t${CMSG}4${CEND}. Uninstall HHVM
 \t${CMSG}5${CEND}. Uninstall PureFtpd
@@ -197,7 +212,7 @@ What Are You Doing?
   echo
   read -p "Please input the correct option: " Number
   if [[ ! $Number =~ ^[0-7,q]$ ]]; then
-    echo "${CWARNING}input error! Please only input 0,1,2,3,4,5,6,7 and q${CEND}"
+    echo "${CWARNING}input error! Please only input 0~7 and q${CEND}"
   else
     case "$Number" in
     0)

+ 3 - 1
versions.txt

@@ -32,6 +32,8 @@ percona55_version=5.5.58-38.10
 
 alisql56_version=5.6.32-7
 
+pgsql_version=10.1
+
 # JDK
 jdk18_version=1.8.0_152
 jdk17_version=1.7.0_80
@@ -51,7 +53,7 @@ curl_version=7.57.0
 libmcrypt_version=2.5.8
 mcrypt_version=2.6.8
 mhash_version=0.9.9.9
-ImageMagick_version=6.9.9-25
+ImageMagick_version=6.9.9-26
 imagick_version=3.4.3
 GraphicsMagick_version=1.3.26
 gmagick_for_php7_version=2.0.4RC1