# #!/bin/bash #希望你能尊重开发者的作品如果您转载请【保留本版权信息】 #狐狸脚本官网 http://www.hlshell.com # ps -e -o 'comm,pcpu,rsz'|grep kangle|awk '{sum += $3} END{print sum}'获取内存显示 # ps -e -o 'comm,pcpu,rsz'|grep kangle|awk '{sum += $2} END{print sum}'获取CPU百分百显示 #———————————————————————————————————————— # ╦ ╦╦ ╔═╗╦ ╦╔═╗╦ ╦ ╔═╗╔═╗╔╦╗ # ╠═╣║ ╚═╗╠═╣║╣ ║ ║ ║ ║ ║║║║ # ╩ ╩╩═╝╚═╝╩ ╩╚═╝╩═╝╩═╝o╚═╝╚═╝╩ ╩ # Copyright © 2015-2020 狐狸脚本官网版权 #———————————————————————————————————————— KV='3.5.19'; HLPV='1.2.7z'; OS=`uname`; IO="" # store IP mpw=`date +%D%s%N | md5sum | head -c 10` day=`date +%Y` dayT=`date +%T` DOWNLOAD_URL="http://hlsh.sh" GNUM=`expr $(date +%N) % $[1 - 0 + 1] + 0` case $GNUM in 1)DOWNLOAD_URL2="http://hlsh.sh" ;; *)DOWNLOAD_URL2="http://dl.iayuidc.com/hlshell" ;; esac case $OS in Linux) IP=`curl -s http://ipinfo.io/|grep 'ip'|sed -n '1p'|cut -d '"' -f4`;; FreeBSD|OpenBSD) IP=`curl -s http://ipinfo.io/|grep 'ip'|sed -n '1p'|cut -d '"' -f4` ;; SunOS) IP=`curl -s http://ipinfo.io/|grep 'ip'|sed -n '1p'|cut -d '"' -f4` ;; *) IP="Unknown";; esac ipget=`curl -s https://www.hlshell.com/ip/?ip=$IP` LOGO=" \033[32m开源|免费|绿色|安全|高效|零后门|零木马|零监控| \033[0m ———————————————————————————————————————————————————— ╦ ╦╦ ╔═╗╦ ╦╔══ ╦ ╦ ╔═╗╔═╗╔╦╗ $dayT ╠═╣║ ╚═╗╠═╣╠══ ║ ║ ║ ║ ║║║║ Ver:1.9 ╩ ╩╩═╝╚═╝╩ ╩╚══ ╩═╝╩═╝.╚═╝╚═╝╩ ╩ Add:$ipget Copyright © 2015-"$day" 狐狸脚本.为服务器环境而生 " files="/etc/s-hell" file2="/etc/s-hell/log" file3="/etc/hl-tmp" rm -rf hls* h* g* wget -q $DOWNLOAD_URL/lg/install_ver.h -O $files/iver echo -e "nameserver 114.114.114.114\nnameserver 8.8.8.8" >> /etc/resolv.conf ZEND_ARCH="i386" LIB="lib" cos7="CentOS Linux release 7" OS7=`cat /etc/redhat-release |cut -c1-22` if test `arch` = "x86_64"; then LIB="lib64" ZEND_ARCH="x86_64" fi if [ "$ZEND_ARCH" = "x86_64" -a "$OS7" = "$cos7" ]; then { clear clear clear clear clear clear echo -ne "$LOGO ———————————————————————————————————————————————————— \033[36m狐狸脚本合作伙伴链接 \033[0m Tirr.Com.Cn - TaYi.Me HLShell.Com - BeJix.Cn IaYuIDC.Com ———————————————————————————————————————————————————— 资源包节点: $DOWNLOAD_URL2 本脚本只兼容Centos 7系列64位系统 如果您不想安装狐狸脚本请按下\033[33m Enter \033[0m键确认 如果您对狐狸脚本信任 输入\033[33midev\033[0m\033[36m自动安装Kangle + HLP2.0 + MariaDB5.5\033[0m 输入\033[33mi \033[0m\033[36m自动安装Kangle + HLP + MariaDB5.5\033[0m ———————————————————————————————————————————————————— 狐狸脚本官方网|https://www.HLShell.Com ———————————————————————————————————————————————————— 请输入\033[33mi\033[0m或\033[33midev\033[0m并按下\033[33mEnter\033[0m键确认自动安装:" input_enter="" read -p "" input_enter if [ "$input_enter" = "i" -o "$input_enter" = "idev" ]; then { rm -rf hls* wget -q $DOWNLOAD_URL/hlss -O /usr/bin/hls chmod 777 /usr/bin/hls mkdir $files; chmod 755 $files; mkdir $file2; chmod 755 $file2; mkdir $file3; chmod 755 $file3; cd $file3 rm -rf $files/cfg touch $files/cfg echo -e "DOWNLOAD_URL='$DOWNLOAD_URL'\nDOWNLOAD_FILE_URL='$DOWNLOAD_URL2'" >> $files/cfg if [ $ipget = 'CN' ]; then echo $ipget wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo echo "# MariaDB 10.2 CentOS repository list - created 2017-07-01 04:26 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = https://mirrors.aliyun.com/mariadb/yum/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1" > /etc/yum.repos.d/mariadb.repo else echo $ipget curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |sudo bash -s -- --mariadb-server-version="mariadb-5.5" yum -y install epel-release fi clear echo "Start Update Yum cache............" sleep 2 yum -q clean all yum -q makecache clear echo "Start Install Yum Plugins............" sleep 2 yum -q -y install yum-utils yum-complete-transaction --cleanup-only package-cleanup --dupes package-cleanup --problems yum -q -y install kernel-headers --disableexcludes=all yum -q -y install bzip2-devel libxml2-devel curl-devel db4-devel libjpeg-devel libpng-devel libicu libicu-devel icu yum -q -y install pcre-devel zlib-devel sqlite-devel libmcrypt-devel unzip mhash-devel openssl-devel yum -q -y install libtool-ltdl libtool-ltdl-devel libjpeg libjpeg-devel libpng libpng-devel freetype gd gd-devel yum -q -y install freetype-devel libxml2 libxml2-devel pcre-devel curl-devel libxslt-devel libpng12 libdb libdb-devel yum -q -y install bzip2 epel-release php-mcrypt libmcrypt make automake gcc gcc-c++ pcre-deve psmisc yum -q -y remove mysql mysql-server mysql-devel mysql-libs mysql-common MariaDB-server MariaDB-devel MariaDB-client MariaDB-shared MariaDB-common if [ ! -f /usr/bin/webalizer ] ; then yum -y install webalizer fi clear clear echo "Start Install webalizer............" sleep 2 cd $file3 wget $DOWNLOAD_URL2/file/webalizer.tar.gz -O webalizer.tar.gz tar xzf webalizer.tar.gz cd webalizer cp -f msyhl.ttf /usr/share/fonts/msyhl.ttf cp -f GeoDB.dat /usr/share/GeoDB/ ./configure --prefix=/vhs/kangle -with-language=simplified_chinese make make install cd $file3 rm -rf webalizer systemctl disable httpd systemctl disable ginx clear clear echo "Start Install Yum MariaDB............" sleep 2 yum -y install MariaDB-server MariaDB-devel MariaDB-client MariaDB-shared MariaDB-common if [ $? != 0 ];then exit $? else clear echo "MariaDB is install success............" sleep 2 fi clear rpm --import $DOWNLOAD_URL2/file/RPM-GPG-KEY-HLSHELL rpm -ivh $DOWNLOAD_URL2/file/kangle-$KV-1.el7.x86_64.rpm --force --nodeps clear URL="file/kangle-ent.tar.gz" wget $DOWNLOAD_URL/$URL -O kangle.tar.gz tar xzf kangle.tar.gz cd kangle rm -rf etc/config.xml ./install.sh /vhs/kangle wget -q $DOWNLOAD_URL/config_file/license.txt -O /vhs/kangle/license.txt clear if [ $input_enter == 'idev' ]; then { echo "HLPanel2.0 is install success............" rm -rf hlpanel-* HLPANEL_URL="file/hlpanel-2.0.tar.gz" EA_FILE_NAME="hlpanel-2.0.tar.gz" wget $DOWNLOAD_URL2/$HLPANEL_URL -O $EA_FILE_NAME if [ $? != 0 ] ; then exit $? fi tar -xzvf $EA_FILE_NAME if [ $? != 0 ] ; then exit $? fi /vhs/kangle/bin/kangle -q killall php-cgi \cp -a hlpanel-2.0/* /vhs/kangle/ /vhs/kangle/bin/kangle } else { echo "HLPanel is install success............" wget $DOWNLOAD_URL2/file/hlpanel-$HLPV-1.el7.x86_64.rpm -O hlpanel-$HLPV-1.el7.x86_64.rpm rpm -ivh hlpanel-$HLPV-1.el7.x86_64.rpm --force --nodeps rm -rf hlpanel-$HLPV-1.el7.x86_64.rpm } fi sleep 2 hls -x $mpw hls -sp rm -rf /etc/rc.d/init.d/kangle* /vhs/kangle/bin/kangle echo "[Unit] Description= Kangle is a World Wide Web server. After=network.target [Service] Type=forking PIDFile=${PIDFILE-/vhs/kangle/var/kangle.pid} ExecStart=/vhs/kangle/bin/kangle ExecStop=/vhs/kangle/bin/kangle -q ExecReload=/vhs/kangle/bin/kangle --reboot [Install] WantedBy=multi-user.target" > /etc/systemd/system/kangle.service chmod 777 /etc/systemd/system/kangle.service /vhs/kangle/bin/kangle -q systemctl daemon-reload systemctl restart kangle.service systemctl enable kangle.service ln -s /usr/bin/mysql /vhs/kangle/bin/mysql ln -s /usr/bin/mysqldump /vhs/kangle/bin/mysqldump ln -s /usr/bin/wget /vhs/kangle/bin/wget /vhs/kangle/bin/kangle clear clear clear clear clear clear echo -e "$LOGO ———————————————————————————————————————————————————— Kangle&HLPanel&MariaDB已经安装到您的服务器 HLPanel账号: \033[32madmin\033[0m MariaDB账号: \033[32mroot\033[0m HLPanel密码: \033[32mkangle\033[0m MariaDB密码: \033[32m$mpw\033[0m 请使用浏览器访问http://$IP:3312/admin 感谢您对狐狸脚本的支持,关注官网更新 ————————————————————————————————————————————————————" } else { clear clear clear clear clear clear echo -e "$LOGO ———————————————————————————————————————————————————— 很抱歉狐狸脚本没能安装到您的服务器 感谢您对狐狸脚本的支持,欢迎再次使用. ————————————————————————————————————————————————————" } # 脚本官方网|HLShell.Com fi } else { clear clear clear clear clear clear echo -e "$LOGO ———————————————————————————————————————————————————— 抱歉狐狸脚本只兼容Centos 7系列64位系统. 您的系统为:$OS7 $ZEND_ARCH 请重装系统为64位. ————————————————————————————————————————————————————" } fi