Browse Source

Update check dir

lj2007331 8 years ago
parent
commit
46e5372357
11 changed files with 17 additions and 28 deletions
  1. 2 4
      backup_setup.sh
  2. 1 1
      config/server.xml
  3. 6 0
      include/check_dir.sh
  4. 0 13
      include/check_web.sh
  5. 1 1
      include/init_Debian.sh
  6. 2 4
      install.sh
  7. 1 1
      reset_db_root_password.sh
  8. 1 1
      tools/db_bk.sh
  9. 1 1
      uninstall.sh
  10. 1 1
      upgrade.sh
  11. 1 1
      vhost.sh

+ 2 - 4
backup_setup.sh

@@ -18,8 +18,9 @@ printf "
 #######################################################################
 "
 
+. ./options.conf
 . ./include/color.sh
-. ./include/check_db.sh
+. ./include/check_dir.sh
 
 # Check if user is root
 [ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
@@ -64,9 +65,6 @@ done
 [ "$CONTENT_BK" == '2' ] && sed -i 's@^backup_content=.*@backup_content=web@' ./options.conf
 [ "$CONTENT_BK" == '3' ] && sed -i 's@^backup_content=.*@backup_content=db,web@' ./options.conf
 
-. ./options.conf
-. ./include/check_db.sh
-
 while :
 do
     echo

+ 1 - 1
config/server.xml

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

+ 6 - 0
include/check_db.sh → include/check_dir.sh

@@ -8,6 +8,12 @@
 #       http://oneinstack.com
 #       https://github.com/lj2007331/oneinstack
 
+# check MySQL dir
 [ -d "$mysql_install_dir/support-files" ] && { db_install_dir=$mysql_install_dir; db_data_dir=$mysql_data_dir; }
 [ -d "$mariadb_install_dir/support-files" ] && { db_install_dir=$mariadb_install_dir; db_data_dir=$mariadb_data_dir; }
 [ -d "$percona_install_dir/support-files" ] && { db_install_dir=$percona_install_dir; db_data_dir=$percona_data_dir; }
+
+# check Nginx dir
+[ -e "$nginx_install_dir/sbin/nginx" ] && web_install_dir=$nginx_install_dir
+[ -e "$tengine_install_dir/sbin/nginx" ] && web_install_dir=$tengine_install_dir
+[ -e "$openresty_install_dir/nginx/sbin/nginx" ] && web_install_dir=$openresty_install_dir/nginx

+ 0 - 13
include/check_web.sh

@@ -1,13 +0,0 @@
-#!/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:
-#       http://oneinstack.com
-#       https://github.com/lj2007331/oneinstack
-
-[ -e "$nginx_install_dir/sbin/nginx" ] && web_install_dir=$nginx_install_dir
-[ -e "$tengine_install_dir/sbin/nginx" ] && web_install_dir=$tengine_install_dir
-[ -e "$openresty_install_dir/nginx/sbin/nginx" ] && web_install_dir=$openresty_install_dir/nginx

+ 1 - 1
include/init_Debian.sh

@@ -20,7 +20,7 @@ apt-get -y update
 [ "$upgrade_yn" == 'y' ] && apt-get -y upgrade
 
 # Install needed packages
-for Package in gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libjpeg-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev libreadline-dev curl libcurl3 libcurl4-openssl-dev libcurl4-gnutls-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev bison re2c libsasl2-dev libxslt1-dev libicu-dev locales libcloog-ppl0 patch vim zip unzip tmux htop wget bc expect rsync git lsof lrzsz cron logrotate ntpdate
+for Package in gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libjpeg-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev libreadline-dev curl libcurl3 libcurl4-openssl-dev libcurl4-gnutls-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev bison re2c libsasl2-dev libxslt1-dev libicu-dev locales libcloog-ppl0 patch vim zip unzip tmux htop wget bc expect rsync git lsof lrzsz cron logrotate ntpdate psmisc
 do
     apt-get -y install $Package
 done

+ 2 - 4
install.sh

@@ -24,8 +24,7 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 . ./options.conf
 . ./include/color.sh
 . ./include/check_os.sh
-. ./include/check_db.sh
-. ./include/check_web.sh
+. ./include/check_dir.sh
 . ./include/download.sh
 . ./include/get_char.sh
 
@@ -628,8 +627,7 @@ if [ ! -e "$wwwroot_dir/default/index.html" -a "$Web_yn" == 'y' ];then
 fi
 
 # get web_install_dir and db_install_dir
-. include/check_db.sh
-. include/check_web.sh
+. include/check_dir.sh
 
 # HHVM
 if [ "$HHVM_yn" == 'y' ];then

+ 1 - 1
reset_db_root_password.sh

@@ -20,7 +20,7 @@ printf "
 
 . ./options.conf
 . ./include/color.sh
-. ./include/check_db.sh
+. ./include/check_dir.sh
 
 # Check if user is root
 [ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }

+ 1 - 1
tools/db_bk.sh

@@ -9,7 +9,7 @@
 #       https://github.com/lj2007331/oneinstack
 
 . ../options.conf
-. ../include/check_db.sh
+. ../include/check_dir.sh
 
 DBname=$1
 LogFile=$backup_dir/db.log

+ 1 - 1
uninstall.sh

@@ -21,7 +21,7 @@ printf "
 . ./options.conf
 . ./include/color.sh
 . ./include/get_char.sh
-. ./include/check_db.sh
+. ./include/check_dir.sh
 
 # Check if user is root
 [ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }

+ 1 - 1
upgrade.sh

@@ -24,7 +24,7 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 . ./options.conf
 . ./include/color.sh
 . ./include/check_os.sh
-. ./include/check_db.sh
+. ./include/check_dir.sh
 . ./include/download.sh
 . ./include/get_char.sh
 . ./include/upgrade_web.sh

+ 1 - 1
vhost.sh

@@ -19,7 +19,7 @@ printf "
 
 . ./options.conf
 . ./include/color.sh
-. ./include/check_web.sh
+. ./include/check_dir.sh
 . ./include/get_char.sh
 
 # Check if user is root