Browse Source

improve oneinstack

lj2007331@gmail.com 6 years ago
parent
commit
b71116aae0
11 changed files with 204 additions and 53 deletions
  1. 30 20
      backup_setup.sh
  2. 8 4
      include/nginx.sh
  3. 8 4
      include/openresty.sh
  4. 1 0
      include/openssl.sh
  5. 8 4
      include/tengine.sh
  6. 19 0
      init.d/nginx.service
  7. 23 0
      init.d/redis-server.service
  8. 99 15
      reset_db_root_password.sh
  9. 2 0
      uninstall.sh
  10. 5 5
      versions.txt
  11. 1 1
      vhost.sh

+ 30 - 20
backup_setup.sh

@@ -170,9 +170,9 @@ fi
 if [ `echo ${desc_bk} | grep -e 3` ]; then
   if [ ! -e "/usr/local/bin/ossutil" ]; then
     if [ "${OS_BIT}" == '64' ]; then
-      wget -qc http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/50452/cn_zh/1516454058701/ossutil64 -O /usr/local/bin/ossutil
+      wget -qc http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/50452/cn_zh/1524643963683/ossutil64 -O /usr/local/bin/ossutil
     elif [ "${OS_BIT}" == '32' ]; then
-      wget -qc http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/50452/cn_zh/1516453988016/ossutil32 -O /usr/local/bin/ossutil
+      wget -qc http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/50452/cn_zh/1524643908776/ossutil32 -O /usr/local/bin/ossutil
     fi
     chmod +x /usr/local/bin/ossutil
   fi
@@ -184,14 +184,15 @@ if [ `echo ${desc_bk} | grep -e 3` ]; then
     echo -e "\t ${CMSG}7${CEND}. cn-shenzhen-华南 1 (深圳)         ${CMSG}8${CEND}. cn-hongkong-香港"
     echo -e "\t ${CMSG}9${CEND}. us-west-美西 1 (硅谷)            ${CMSG}10${CEND}. us-east-美东 1 (弗吉尼亚)"
     echo -e "\t${CMSG}11${CEND}. ap-southeast-亚太东南 1 (新加坡) ${CMSG}12${CEND}. ap-southeast-亚太东南 2 (悉尼)"
-    echo -e "\t${CMSG}13${CEND}. ap-southeast-亚太东南 3 (吉隆坡) ${CMSG}14${CEND}. ap-northeast-亚太东北 1 (日本)"
-    echo -e "\t${CMSG}15${CEND}. eu-central-欧洲中部 1 (法兰克福) ${CMSG}16${CEND}. me-east-中东东部 1 (迪拜)"
+    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
     [ -z "${Location}" ] && Location=1
-    if [[ "${Location}" =~ ^[1-9]$|^1[0-6]$ ]]; then
+    if [[ "${Location}" =~ ^[1-9]$|^1[0-8]$ ]]; then
       break
     else
-      echo "${CWARNING}input error! Please only input number 1~16${CEND}"
+      echo "${CWARNING}input error! Please only input number 1~18${CEND}"
     fi
   done
   [ "${Location}" == '1' ] && Host=oss-cn-hangzhou-internal.aliyuncs.com
@@ -207,9 +208,11 @@ if [ `echo ${desc_bk} | grep -e 3` ]; then
   [ "${Location}" == '11' ] && Host=oss-ap-southeast-1-internal.aliyuncs.com
   [ "${Location}" == '12' ] && Host=oss-ap-southeast-2-internal.aliyuncs.com
   [ "${Location}" == '13' ] && Host=oss-ap-southeast-3-internal.aliyuncs.com
-  [ "${Location}" == '14' ] && Host=oss-ap-northeast-1-internal.aliyuncs.com
-  [ "${Location}" == '15' ] && Host=oss-eu-central-1-internal.aliyuncs.com
-  [ "${Location}" == '16' ] && Host=oss-me-east-1-internal.aliyuncs.com
+  [ "${Location}" == '14' ] && Host=oss-ap-southeast-5-internal.aliyuncs.com
+  [ "${Location}" == '15' ] && Host=oss-ap-northeast-1-internal.aliyuncs.com
+  [ "${Location}" == '16' ] && Host=oss-ap-south-1-internal.aliyuncs.com
+  [ "${Location}" == '17' ] && Host=oss-eu-central-1-internal.aliyuncs.com
+  [ "${Location}" == '18' ] && Host=oss-me-east-1-internal.aliyuncs.com
   [ "$(./include/check_port.py ${Host} 80)" == "False" ] && Host=`echo ${Host} | sed 's@-internal@@g'`
   [ -e "/root/.ossutilconfig" ] && rm -f /root/.ossutilconfig
   while :; do echo
@@ -236,17 +239,19 @@ if [ `echo ${desc_bk} | grep -e 4` ]; then
   [ ! -e "${python_install_dir}/lib/coscmd" ] && ${python_install_dir}/bin/pip install coscmd >/dev/null 2>&1
   while :; do echo
     echo 'Please select your backup datacenter:'
-    echo -e "\t ${CMSG}1${CEND}. 北京一区(华北)  ${CMSG}2${CEND}. 北京"
-    echo -e "\t ${CMSG}3${CEND}. 上海(华东)      ${CMSG}4${CEND}. 广州(华南)"
-    echo -e "\t ${CMSG}5${CEND}. 成都(西南)      ${CMSG}6${CEND}. 新加坡"
-    echo -e "\t ${CMSG}7${CEND}. 香港            ${CMSG}8${CEND}. 多伦多"
-    echo -e "\t ${CMSG}9${CEND}. 法兰克福"
+    echo -e "\t ${CMSG} 1${CEND}. 北京一区(华北)  ${CMSG}2${CEND}. 北京"
+    echo -e "\t ${CMSG} 3${CEND}. 上海(华东)      ${CMSG}4${CEND}. 广州(华南)"
+    echo -e "\t ${CMSG} 5${CEND}. 成都(西南)      ${CMSG}6${CEND}. 重庆"
+    echo -e "\t ${CMSG} 7${CEND}. 新加坡          ${CMSG}8${CEND}. 香港"
+    echo -e "\t ${CMSG} 9${CEND}. 多伦多         ${CMSG}10${CEND}. 法兰克福"
+    echo -e "\t ${CMSG}11${CEND}. 孟买           ${CMSG}12${CEND}. 首尔"
+    echo -e "\t ${CMSG}13${CEND}. 硅谷           ${CMSG}14${CEND}. 弗吉尼亚"
     read -p "Please input a number:(Default 1 press Enter) " Location
     [ -z "${Location}" ] && Location=1
-    if [[ "${Location}" =~ ^[1-9]$ ]]; then
+    if [[ "${Location}" =~ ^[1-9]$|^1[0-4]$ ]]; then
       break
     else
-      echo "${CWARNING}input error! Please only input number 1~9${CEND}"
+      echo "${CWARNING}input error! Please only input number 1~14${CEND}"
     fi
   done
   [ "${Location}" == '1' ] && region='ap-beijing-1'
@@ -254,10 +259,15 @@ if [ `echo ${desc_bk} | grep -e 4` ]; then
   [ "${Location}" == '3' ] && region='ap-shanghai'
   [ "${Location}" == '4' ] && region='ap-guangzhou'
   [ "${Location}" == '5' ] && region='ap-chengdu'
-  [ "${Location}" == '6' ] && region='ap-singapore'
-  [ "${Location}" == '7' ] && region='ap-hongkong'
-  [ "${Location}" == '8' ] && region='na-toronto'
-  [ "${Location}" == '9' ] && region='eu-frankfurt'
+  [ "${Location}" == '6' ] && region='ap-chongqing'
+  [ "${Location}" == '7' ] && region='ap-singapore'
+  [ "${Location}" == '8' ] && region='ap-hongkong'
+  [ "${Location}" == '9' ] && region='na-toronto'
+  [ "${Location}" == '10' ] && region='eu-frankfurt'
+  [ "${Location}" == '11' ] && region='ap-mumbai'
+  [ "${Location}" == '12' ] && region='ap-seoul'
+  [ "${Location}" == '13' ] && region='na-siliconvalley'
+  [ "${Location}" == '14' ] && region='na-ashburn'
   while :; do echo
     read -p "Please enter the Qcloud COS APPID: " APPID
     [ -z "${APPID}" ] && continue

+ 8 - 4
include/nginx.sh

@@ -44,10 +44,14 @@ Install_Nginx() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${nginx_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${nginx_install_dir}/sbin:\1@" /etc/profile
   . /etc/profile
 
-  [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-  [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; update-rc.d nginx defaults; }
-
-  sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx
+  if [ -e /bin/systemctl ]; then
+    /bin/cp ../init.d/nginx.service /lib/systemd/system/
+    sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /lib/systemd/system/nginx.service
+    systemctl enable nginx
+  else
+    [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+    [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
+  fi
 
   mv ${nginx_install_dir}/conf/nginx.conf{,_bk}
   if [[ ${apache_option} =~ ^[1-2]$ ]]; then

+ 8 - 4
include/openresty.sh

@@ -41,10 +41,14 @@ Install_OpenResty() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${openresty_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${openresty_install_dir}/nginx/sbin:\1@" /etc/profile
   . /etc/profile
 
-  [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-  [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; update-rc.d nginx defaults; }
-
-  sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx
+  if [ -e /bin/systemctl ]; then
+    /bin/cp ../init.d/nginx.service /lib/systemd/system/
+    sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /lib/systemd/system/nginx.service
+    systemctl enable nginx
+  else
+    [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+    [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
+  fi
 
   mv ${openresty_install_dir}/nginx/conf/nginx.conf{,_bk}
   if [[ ${apache_option} =~ ^[1-2]$ ]]; then

+ 1 - 0
include/openssl.sh

@@ -21,6 +21,7 @@ Install_openSSL102() {
     if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
       echo "${CSUCCESS}openssl-1.0.2 module installed successfully! ${CEND}"
       /bin/cp cacert.pem ${openssl_install_dir}/cacert.pem
+      /bin/cp cacert.pem ${openssl_install_dir}/cert.pem
       rm -rf openssl-${openssl_ver}
     else
       echo "${CFAILURE}openssl-1.0.2 install failed, Please contact the author! ${CEND}"

+ 8 - 4
include/tengine.sh

@@ -42,10 +42,14 @@ Install_Tengine() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${tengine_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${tengine_install_dir}/sbin:\1@" /etc/profile
   . /etc/profile
 
-  [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-  [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; update-rc.d nginx defaults; }
-
-  sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx
+  if [ -e /bin/systemctl ]; then
+    /bin/cp ../init.d/nginx.service /lib/systemd/system/
+    sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /lib/systemd/system/nginx.service
+    systemctl enable nginx
+  else
+    [ "${OS}" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
+    [[ ${OS} =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
+  fi
 
   mv ${tengine_install_dir}/conf/nginx.conf{,_bk}
   if [[ ${apache_option} =~ ^[1-2]$ ]]; then

+ 19 - 0
init.d/nginx.service

@@ -0,0 +1,19 @@
+[Unit]
+Description=nginx - high performance web server
+Documentation=http://nginx.org/en/docs/
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/nginx.pid
+ExecStartPost=/bin/sleep 0.1
+ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
+ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
+ExecReload=/usr/local/nginx/sbin/nginx -s reload
+ExecStop=/usr/local/nginx/sbin/nginx -s stop
+LimitNOFILE=1000000
+LimitNPROC=1000000
+LimitCORE=1000000
+
+[Install]
+WantedBy=multi-user.target

+ 23 - 0
init.d/redis-server.service

@@ -0,0 +1,23 @@
+[Unit]
+Description=Redis In-Memory Data Store
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/redis/redis.pid
+User=redis
+Group=redis
+
+Environment=statedir=/var/run/redis
+PermissionsStartOnly=true
+ExecStartPre=/bin/mkdir -p ${statedir}
+ExecStartPre=/bin/chown -R redis:redis ${statedir}
+ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
+ExecStop=/usr/local/redis/bin/redis-cli shutdown
+Restart=always
+LimitNOFILE=1000000
+LimitNPROC=1000000
+LimitCORE=1000000
+
+[Install]
+WantedBy=multi-user.target

+ 99 - 15
reset_db_root_password.sh

@@ -22,23 +22,61 @@ pushd ${oneinstack_dir} > /dev/null
 . ./options.conf
 . ./include/color.sh
 . ./include/check_dir.sh
+[ ! -d "${db_install_dir}" ] && { echo "${CFAILURE}Database is not installed on your system! ${CEND}"; exit 1; }
 
-Input_db_root_password() {
-  [ ! -d "${db_install_dir}" ] && { echo "${CFAILURE}Database is not installed on your system! ${CEND}"; exit 1; }
+showhelp() {
+  echo "Usage: $0  command ...[parameters]....
+  -h,  --help                  print this help.
+  -q,  --quiet                 quiet operation.
+  -f,  --force                 Lost Database Password? Forced reset password.
+  -p,  --password [pass]       DB super password.
+  "
+}
+
+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
+eval set -- "${TEMP}"
+while :; do
+  [ -z "$1" ] && break;
+  case "$1" in
+    -h|--help)
+      showhelp; exit 0
+      ;;
+    -q|--quiet)
+      quiet_yn=y; shift 1
+      ;;
+    -f|--force)
+      force_yn=y; shift 1
+      ;;
+    -p|--password)
+      New_dbrootpwd=$2; shift 2
+      password_flag=y
+      ;;
+    --)
+      shift
+      ;;
+    *)
+      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && showhelp && exit 1
+      ;;
+  esac
+done
+
+Input_dbrootpwd() {
   while :; do echo
     read -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; }
+    [ -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
 }
 
-Reset_db_root_password() {
-  ${db_install_dir}/bin/mysqladmin -uroot -p"$dbrootpwd" password "$New_dbrootpwd" -h localhost > /dev/null 2>&1
+Reset_Interaction_dbrootpwd() {
+  ${db_install_dir}/bin/mysqladmin -uroot -p"${dbrootpwd}" password "${New_dbrootpwd}" -h localhost > /dev/null 2>&1
   status_Localhost=`echo $?`
-  ${db_install_dir}/bin/mysqladmin -uroot -p"$dbrootpwd" password "$New_dbrootpwd" -h 127.0.0.1 > /dev/null 2>&1
+  ${db_install_dir}/bin/mysqladmin -uroot -p"${dbrootpwd}" password "${New_dbrootpwd}" -h 127.0.0.1 > /dev/null 2>&1
   status_127=`echo $?`
-  if [ $status_Localhost == '0' -a $status_127 == '0' ]; then
-    sed -i "s+^dbrootpwd.*+dbrootpwd='$New_dbrootpwd'+" ./options.conf
+  if [ ${status_Localhost} == '0' -a ${status_127} == '0' ]; then
+    sed -i "s+^dbrootpwd.*+dbrootpwd='${New_dbrootpwd}'+" ./options.conf
     echo
     echo "Password reset succesfully! "
     echo "The new password: ${CMSG}${New_dbrootpwd}${CEND}"
@@ -48,13 +86,59 @@ Reset_db_root_password() {
   fi
 }
 
-if [ "$1" == 'quiet' ]; then
-  New_dbrootpwd="`< /dev/urandom tr -dc A-Za-z0-9 | head -c8`"
-  sleep 2 && [ ! -e /tmp/mysql.sock ] && /etc/init.d/mysqld start
-  Reset_db_root_password
-  [ $? -eq 0 ] && sed -i '/reset_db_root_password/d' /etc/rc.d/rc.local
+Reset_force_dbrootpwd() {
+  DB_Ver="`${db_install_dir}/bin/mysql_config --version`"
+  echo "${CMSG}Stopping MySQL...${CEND}"
+  /etc/init.d/mysqld stop > /dev/null 2>&1
+  while [ -n "`ps -ef | grep mysql | grep -v grep | awk '{print $2}'`" ]; do
+    sleep 1
+  done
+  echo "${CMSG}skip grant tables...${CEND}"
+  ${db_install_dir}/bin/mysqld_safe --skip-grant-tables > /dev/null 2>&1 &
+  while [ -z "`ps -ef | grep 'mysqld ' | grep -v grep | awk '{print $2}'`" ]; do
+    sleep 1
+  done
+  if echo "${DB_Ver}" | grep -Eqi '^8.0.|^5.7.|^10.2.'; then
+    ${db_install_dir}/bin/mysql -uroot -hlocalhost << EOF
+flush privileges;
+alter user 'root'@'localhost' identified by "${New_dbrootpwd}";
+alter user 'root'@'127.0.0.1' identified by "${New_dbrootpwd}";
+EOF
+  else
+    ${db_install_dir}/bin/mysql -uroot -hlocalhost << EOF
+update mysql.user set password = Password("${New_dbrootpwd}") where User = 'root';
+EOF
+  fi
+  if [ $? -eq 0 ]; then
+    killall mysqld
+    while [ -n "`ps -ef | grep mysql | grep -v grep | awk '{print $2}'`" ]; do
+      sleep 1
+    done
+    [ -n "`ps -ef | grep mysql | grep -v grep | awk '{print $2}'`" ] && ps -ef | grep mysql | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
+    /etc/init.d/mysqld start > /dev/null 2>&1
+    sed -i "s+^dbrootpwd.*+dbrootpwd='${New_dbrootpwd}'+" ./options.conf
+    echo
+    echo "Password reset succesfully! "
+    echo "The new password: ${CMSG}${New_dbrootpwd}${CEND}"
+    echo
+  fi
+}
+
+[ "${password_flag}" == 'y' ] && quiet_yn=y
+if [ "${quiet_yn}" == 'y' ]; then
+  if [ "${force_yn}" == 'y' ]; then
+    Reset_force_dbrootpwd
+  else
+    sleep 2 && [ ! -e /tmp/mysql.sock ] && /etc/init.d/mysqld start
+    Reset_Interaction_dbrootpwd
+    [ $? -eq 0 ] && [ -n "`grep reset_db_root_password /etc/rc.local`" ] && sed -i '/reset_db_root_password/d' /etc/rc.d/rc.local > /dev/null 2>&1
+  fi
 else
-  Input_db_root_password
-  Reset_db_root_password
+  Input_dbrootpwd
+  if [ "${force_yn}" == 'y' ]; then
+    Reset_force_dbrootpwd
+  else
+    Reset_Interaction_dbrootpwd
+  fi
 fi
 popd > /dev/null

+ 2 - 0
uninstall.sh

@@ -66,6 +66,7 @@ Print_web() {
   [ -d "${tengine_install_dir}" ] && echo "${tengine_install_dir}"
   [ -d "${openresty_install_dir}" ] && echo "${openresty_install_dir}"
   [ -e "/etc/init.d/nginx" ] && echo '/etc/init.d/nginx'
+  [ -e "/lib/systemd/system/nginx.service" ] && echo '/lib/systemd/system/nginx.service'
   [ -e "/etc/logrotate.d/nginx" ] && echo '/etc/logrotate.d/nginx'
 
   [ -d "${apache_install_dir}" ] && echo "${apache_install_dir}"
@@ -80,6 +81,7 @@ Print_web() {
 }
 
 Uninstall_Web() {
+  [ -e "/lib/systemd/system/nginx.service" ] && { systemctl disable nginx > /dev/null 2>&1; rm -f /lib/systemd/system/nginx.service; }
   [ -d "${nginx_install_dir}" ] && { killall nginx > /dev/null 2>&1; rm -rf ${nginx_install_dir} /etc/init.d/nginx /etc/logrotate.d/nginx; sed -i "s@${nginx_install_dir}/sbin:@@" /etc/profile; echo "${CMSG}Nginx uninstall completed! ${CEND}"; }
   [ -d "${tengine_install_dir}" ] && { killall nginx > /dev/null 2>&1; rm -rf ${tengine_install_dir} /etc/init.d/nginx /etc/logrotate.d/nginx; sed -i "s@${tengine_install_dir}/sbin:@@" /etc/profile; echo "${CMSG}Tengine uninstall completed! ${CEND}"; }
   [ -d "${openresty_install_dir}" ] && { killall nginx > /dev/null 2>&1; rm -rf ${openresty_install_dir} /etc/init.d/nginx /etc/logrotate.d/nginx; sed -i "s@${openresty_install_dir}/nginx/sbin:@@" /etc/profile; echo "${CMSG}OpenResty uninstall completed! ${CEND}"; }

+ 5 - 5
versions.txt

@@ -15,7 +15,7 @@ apache22_ver=2.2.34
 pcre_ver=8.42
 apr_ver=1.6.3
 apr_util_ver=1.6.1
-nghttp2_ver=1.31.1
+nghttp2_ver=1.32.0
 
 # DB
 mysql80_ver=8.0.11
@@ -24,8 +24,8 @@ mysql56_ver=5.6.40
 mysql55_ver=5.5.60
 
 mariadb102_ver=10.2.14
-mariadb101_ver=10.1.32
-mariadb100_ver=10.0.34
+mariadb101_ver=10.1.33
+mariadb100_ver=10.0.35
 mariadb55_ver=5.5.60
 
 percona57_ver=5.7.21-21
@@ -61,7 +61,7 @@ mcrypt_ver=2.6.8
 mhash_ver=0.9.9.9
 libsodium_ver=1.0.16
 argon2_ver=20171227
-imagemagick_ver=6.9.9-40
+imagemagick_ver=6.9.9-43
 imagick_ver=3.4.3
 graphicsmagick_ver=1.3.28
 gmagick_for_php7_ver=2.0.5RC1
@@ -97,7 +97,7 @@ phpmyadmin_ver=4.8.0.1
 phpmyadmin_oldver=4.4.15.10
 
 # jemalloc
-jemalloc_ver=5.0.1
+jemalloc_ver=5.1.0
 
 # boost
 boost_ver=1.66.0

+ 1 - 1
vhost.sh

@@ -420,7 +420,7 @@ Nginx_anti_hotlinking() {
   fi
 
   if [ "${anti_hotlinking_flag}" == 'y' ]; then
-    if [ "${moredomainame_flag}" == 'y' -a "*.${domain}" != "${moredomainame}" ]; then
+    if [ "${moredomainame_flag}" == 'y' -a "${moredomain}" != "*.${domain}" ]; then
       domain_allow_all=${domain_allow}${moredomainame}
     else
       domain_allow_all=${domain_allow}