Browse Source

use xprober

lj2007331@gmail.com 6 years ago
parent
commit
b66168bf03
9 changed files with 59 additions and 24 deletions
  1. 1 1
      addons.sh
  2. 2 2
      backup_setup.sh
  3. 3 5
      config/index.html
  4. 3 5
      config/index_cn.html
  5. 2 7
      include/demo.sh
  6. 13 0
      include/python.sh
  7. 11 1
      install.sh
  8. 22 3
      uninstall.sh
  9. 2 0
      versions.txt

+ 1 - 1
addons.sh

@@ -49,7 +49,7 @@ Show_Help() {
   --composer                  Composer
   --fail2ban                  Fail2ban
   --ngx_lua_waf               Ngx_lua_waf
-  --python                    Python3.6
+  --python                    Python (PATH: ${python_install_dir})
   "
 }
 

+ 2 - 2
backup_setup.sh

@@ -368,8 +368,8 @@ if [ -n "`echo ${desc_bk} | grep -w 6`" ]; then
     chmod +x /usr/local/bin/qrsctl
   fi
   if [ ! -e "/usr/local/bin/qshell" ]; then
-    wget -qc http://devtools.qiniu.com/qshell-v2.3.5.zip -O /tmp/qshell-v2.3.5.zip
-    unzip -q /tmp/qshell-v2.3.5.zip -d /tmp/
+    wget -qc http://devtools.qiniu.com/qshell-v2.3.6.zip -O /tmp/qshell-v2.3.6.zip
+    unzip -q /tmp/qshell-v2.3.6.zip -d /tmp/
     if [ "${OS_BIT}" == '64' ]; then
       /bin/cp /tmp/qshell-linux-x64 /usr/local/bin/qshell
     elif [ "${OS_BIT}" == '32' ]; then

+ 3 - 5
config/index.html

@@ -137,8 +137,7 @@
 	            <h1 class="h2" id="home">Control center</h1>
 	            <div class="btn-toolbar mb-2 mb-md-0">
 	              <div class="btn-group mr-2">
-	                <a class="btn btn-sm btn-outline-primary btn_prober" href="prober.php" target="_blank"><span data-feather="compass"></span> prober</a>
-	                <a class="btn btn-sm btn-outline-primary btn_tz" href="tz.php" target="_blank"><span data-feather="compass"></span> 探针</a>
+	                <a class="btn btn-sm btn-outline-primary btn_prober" href="xprober.php" target="_blank"><span data-feather="compass"></span> prober</a>
 	                <a class="btn btn-sm btn-outline-info btn_phpinfo" href="phpinfo.php" target="_blank"><span data-feather="info"></span> phpinfo</a>
 	                <a class="btn btn-sm btn-outline-secondary btn_op" href="ocp.php" target="_blank"><span data-feather="cpu"></span> Opcache</a>
 	              </div>
@@ -156,8 +155,7 @@
 		
 			<section class="section" id="tools_section">
 	          <h2 class="mt-5" id="tools">Tools</h2>
-	          	<a class="btn btn-primary btn_tz" href="tz.php" target="_blank" role="button">探针</a>
-	          	<a class="btn btn-primary btn_prober" href="prober.php" target="_blank" role="button">prober</a>
+	          	<a class="btn btn-primary btn_prober" href="xprober.php" target="_blank" role="button">prober</a>
 	          	<a class="btn btn-info btn_phpinfo" href="phpinfo.php" target="_blank" role="button">phpinfo</a>
 	          	<a class="btn btn-success btn_pma" href="phpMyAdmin/" target="_blank" role="button">phpMyAdmin</a>
 	          	<a class="btn btn-secondary btn_op" href="ocp.php" target="_blank" role="button">Opcache</a>
@@ -329,6 +327,6 @@
         </main>
       </div>
     </div>
-    <script src="https://static.oneinstack.com/assets/ois.js"></script>
+    <script src="https://static.oneinstack.com/assets/ois20190114.js"></script>
   </body>
 </html>

+ 3 - 5
config/index_cn.html

@@ -137,8 +137,7 @@
 	            <h1 class="h2" id="home">控制中心</h1>
 	            <div class="btn-toolbar mb-2 mb-md-0">
 	              <div class="btn-group mr-2">
-	                <a class="btn btn-sm btn-outline-primary btn_prober" href="prober.php" target="_blank"><span data-feather="compass"></span> prober</a>
-	                <a class="btn btn-sm btn-outline-primary btn_tz" href="tz.php" target="_blank"><span data-feather="compass"></span> 探针</a>
+	                <a class="btn btn-sm btn-outline-primary btn_prober" href="xprober.php" target="_blank"><span data-feather="compass"></span> 探针</a>
 	                <a class="btn btn-sm btn-outline-info btn_phpinfo" href="phpinfo.php" target="_blank"><span data-feather="info"></span> phpinfo</a>
 	                <a class="btn btn-sm btn-outline-secondary btn_op" href="ocp.php" target="_blank"><span data-feather="cpu"></span> Opcache</a>
 	              </div>
@@ -156,8 +155,7 @@
 		
 			<section class="section" id="tools_section">
 	          <h2 class="mt-5" id="tools">主机工具</h2>
-	          	<a class="btn btn-primary btn_tz" href="tz.php" target="_blank" role="button">探针</a>
-	          	<a class="btn btn-primary btn_prober" href="prober.php" target="_blank" role="button">prober</a>
+	          	<a class="btn btn-primary btn_prober" href="xprober.php" target="_blank" role="button">探针</a>
 	          	<a class="btn btn-info btn_phpinfo" href="phpinfo.php" target="_blank" role="button">phpinfo</a>
 	          	<a class="btn btn-success btn_pma" href="phpMyAdmin/" target="_blank" role="button">phpMyAdmin</a>
 	          	<a class="btn btn-secondary btn_op" href="ocp.php" target="_blank" role="button">Opcache</a>
@@ -332,6 +330,6 @@
         </main>
       </div>
     </div>
-    <script src="https://static.oneinstack.com/assets/ois.js"></script>
+    <script src="https://static.oneinstack.com/assets/ois20190114.js"></script>
   </body>
 </html>

+ 2 - 7
include/demo.sh

@@ -13,13 +13,8 @@ DEMO() {
   [ "${IPADDR_COUNTRY}"x == "CN"x ] && /bin/cp ${oneinstack_dir}/config/index_cn.html ${wwwroot_dir}/default/index.html || /bin/cp ${oneinstack_dir}/config/index.html ${wwwroot_dir}/default
 
   if [ -e "${php_install_dir}/bin/php" ]; then
-    if [ "${IPADDR_COUNTRY}"x == "CN"x ]; then
-      src_url=http://mirrors.linuxeye.com/oneinstack/src/tz.zip && Download_src
-      unzip -q tz.zip -d ${wwwroot_dir}/default
-    else
-      src_url=http://mirrors.linuxeye.com/oneinstack/src/tz_e.zip && Download_src
-      unzip -q tz_e.zip -d ${wwwroot_dir}/default;/bin/mv ${wwwroot_dir}/default/{tz_e.php,prober.php}
-    fi
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/xprober.php && Download_src
+    /bin/cp xprober.php ${wwwroot_dir}/default
 
     echo "<?php phpinfo() ?>" > ${wwwroot_dir}/default/phpinfo.php
     case "${phpcache_option}" in

+ 13 - 0
include/python.sh

@@ -59,6 +59,19 @@ EOF
       popd > /dev/null
     fi
 
+    if [ ! -e "${python_install_dir}/bin/pip" ]; then
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/setuptools-${setuptools_ver}.zip && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/pip-${pip_ver}.tar.gz && Download_src
+      unzip -q setuptools-${setuptools_ver}.zip
+      tar xzf pip-${pip_ver}.tar.gz
+      pushd setuptools-${setuptools_ver} > /dev/null
+      ${python_install_dir}/bin/python setup.py install
+      popd > /dev/null
+      pushd pip-${pip_ver} > /dev/null
+      ${python_install_dir}/bin/python setup.py install
+      popd > /dev/null
+    fi
+
     if [ ! -e "/root/.pip/pip.conf" ] ;then
       # get the IP information
       PUBLIC_IPADDR=$(../include/get_public_ipaddr.py)

+ 11 - 1
install.sh

@@ -63,13 +63,14 @@ Show_Help() {
   --memcached                 Install Memcached
   --phpmyadmin                Install phpMyAdmin
   --hhvm                      Install HHVM
+  --python                    Install Python (PATH: ${python_install_dir})
   --ssh_port [No.]            SSH port
   --iptables                  Enable iptables
   --reboot                    Restart the server after installation
   "
 }
 ARG_NUM=$#
-TEMP=`getopt -o hvV --long help,version,nginx_option:,apache_option:,php_option:,php_vn:,phpcache_option:,php_extensions:,tomcat_option:,jdk_option:,db_option:,dbrootpwd:,dbinstallmethod:,pureftpd,redis,memcached,phpmyadmin,hhvm,ssh_port:,iptables,reboot -- "$@" 2>/dev/null`
+TEMP=`getopt -o hvV --long help,version,nginx_option:,apache_option:,php_option:,php_vn:,phpcache_option:,php_extensions:,tomcat_option:,jdk_option:,db_option:,dbrootpwd:,dbinstallmethod:,pureftpd,redis,memcached,phpmyadmin,hhvm,python,ssh_port:,iptables,reboot -- "$@" 2>/dev/null`
 [ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
@@ -174,6 +175,9 @@ while :; do
       hhvm_flag=y; shift 1
       [ -e "/usr/bin/hhvm" ] && { echo "${CWARNING}HHVM already installed! ${CEND}"; unset hhvm_flag; }
       ;;
+    --python)
+      python_flag=y; shift 1
+      ;;
     --ssh_port)
       ssh_port=$2; shift 2
       ;;
@@ -1064,6 +1068,12 @@ if [ "${hhvm_flag}" == 'y' ] && [ "${PM}" == 'yum' -a "${OS_BIT}" == '64' ] && [
   Install_hhvm_CentOS 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
+# Python
+if [ "${python_flag}" == 'y' ]; then
+  . include/python.sh
+  Install_Python 2>&1 | tee -a ${oneinstack_dir}/install.log
+fi
+
 # Starting DB
 [ -d "/etc/mysql" ] && /bin/mv /etc/mysql{,_bk}
 [ -d "${db_install_dir}/support-files" ] && service mysqld start

+ 22 - 3
uninstall.sh

@@ -47,11 +47,12 @@ Show_Help() {
   --redis                       Uninstall Redis-server
   --memcached                   Uninstall Memcached-server
   --phpmyadmin                  Uninstall phpMyAdmin
+  --python                      Uninstall Python (PATH: ${python_install_dir})
   "
 }
 
 ARG_NUM=$#
-TEMP=`getopt -o hvVq --long help,version,quiet,all,web,mysql,postgresql,mongodb,php,phpcache,php_extensions:,hhvm,pureftpd,redis,memcached,phpmyadmin -- "$@" 2>/dev/null`
+TEMP=`getopt -o hvVq --long help,version,quiet,all,web,mysql,postgresql,mongodb,php,phpcache,php_extensions:,hhvm,pureftpd,redis,memcached,phpmyadmin,python -- "$@" 2>/dev/null`
 [ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
@@ -77,6 +78,7 @@ while :; do
       redis_flag=y
       memcached_flag=y
       phpmyadmin_flag=y
+      python_flag=y
       shift 1
       ;;
     --web)
@@ -129,6 +131,9 @@ while :; do
     --phpmyadmin)
       phpmyadmin_flag=y; shift 1
       ;;
+    --python)
+      python_flag=y; shift 1
+      ;;
     --)
       shift
       ;;
@@ -492,6 +497,10 @@ Uninstall_openssl() {
   [ -d "${openssl_install_dir}" ] && rm -rf ${openssl_install_dir}
 }
 
+Print_Python() {
+  [ -d "${python_install_dir}" ] && echo "${python_install_dir}"
+}
+
 Menu() {
 while :; do
   printf "
@@ -509,12 +518,13 @@ What Are You Doing?
 \t${CMSG}10${CEND}. Uninstall Redis
 \t${CMSG}11${CEND}. Uninstall Memcached
 \t${CMSG}12${CEND}. Uninstall phpMyAdmin
+\t${CMSG}13${CEND}. Uninstall Python (PATH: ${python_install_dir})
 \t${CMSG} q${CEND}. Exit
 "
   echo
   read -e -p "Please input the correct option: " Number
-  if [[ ! "${Number}" =~ ^[0-9,q]$|^1[0-2]$ ]]; then
-    echo "${CWARNING}input error! Please only input 0~12 and q${CEND}"
+  if [[ ! "${Number}" =~ ^[0-9,q]$|^1[0-3]$ ]]; then
+    echo "${CWARNING}input error! Please only input 0~13 and q${CEND}"
   else
     case "$Number" in
     0)
@@ -530,6 +540,7 @@ What Are You Doing?
       Print_Memcached_server
       Print_openssl
       Print_phpMyAdmin
+      Print_Python
       Uninstall_status
       if [ "${uninstall_flag}" == 'y' ]; then
         Uninstall_Web
@@ -543,6 +554,7 @@ What Are You Doing?
         Uninstall_Memcached_server
         Uninstall_openssl
         Uninstall_phpMyAdmin
+        . include/python.sh; Uninstall_Python
       else
         exit
       fi
@@ -610,6 +622,11 @@ What Are You Doing?
       Uninstall_status
       [ "${uninstall_flag}" == 'y' ] && Uninstall_phpMyAdmin || exit
       ;;
+    13)
+      Print_Python
+      Uninstall_status
+      [ "${uninstall_flag}" == 'y' ] && { . include/python.sh; Uninstall_Python; } || exit
+      ;;
     q)
       exit
       ;;
@@ -631,6 +648,7 @@ else
   [ "${redis_flag}" == 'y' ] && Print_Redis_server
   [ "${memcached_flag}" == 'y' ] && Print_Memcached_server
   [ "${phpmyadmin_flag}" == 'y' ] && Print_phpMyAdmin
+  [ "${python_flag}" == 'y' ] && Print_Python
   [ "${all_flag}" == 'y' ] && Print_openssl
   Uninstall_status
   if [ "${uninstall_flag}" == 'y' ]; then
@@ -646,6 +664,7 @@ else
     [ "${redis_flag}" == 'y' ] && Uninstall_Redis_server
     [ "${memcached_flag}" == 'y' ] && Uninstall_Memcached_server
     [ "${phpmyadmin_flag}" == 'y' ] && Uninstall_phpMyAdmin
+    [ "${python_flag}" == 'y' ] && { . include/python.sh; Uninstall_Python; }
     [ "${all_flag}" == 'y' ] && Uninstall_openssl
   fi
 fi

+ 2 - 0
versions.txt

@@ -114,4 +114,6 @@ tmux_ver=2.8
 htop_ver=2.2.0
 bison_ver=2.7.1
 python_ver=3.6.8
+setuptools_ver=40.6.3
+pip_ver=18.1
 fail2ban_ver=0.10.4