From b7088093e2237e3a49b6339d101f7a61e94c1366 Mon Sep 17 00:00:00 2001 From: chauncey Date: Mon, 24 Aug 2020 17:48:45 +0800 Subject: [PATCH] Update mtproxy.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加 mtproto-proxy 二进制版,免去编译及装依赖的部分。 --- mtproxy.sh | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/mtproxy.sh b/mtproxy.sh index 0ec1ae4..90d70ae 100644 --- a/mtproxy.sh +++ b/mtproxy.sh @@ -70,29 +70,41 @@ install(){ xxd_status=0 fi - if check_sys packageManager yum; then - yum install -y openssl-devel zlib-devel - yum groupinstall -y "Development Tools" - if [ $xxd_status == 0 ];then + if [[ "`uname -m`" != "x86_64" ]]; then + if check_sys packageManager yum; then + yum install -y openssl-devel zlib-devel + yum groupinstall -y "Development Tools" + if [ $xxd_status == 0 ];then + yum install -y vim-common + fi + elif check_sys packageManager apt; then + apt-get -y update + apt install -y git curl build-essential libssl-dev zlib1g-dev + if [ $xxd_status == 0 ];then + apt install -y vim-common + fi + fi + else + if check_sys packageManager yum && [ $xxd_status == 0 ]; then yum install -y vim-common - fi - elif check_sys packageManager apt; then - apt-get -y update - apt install -y git curl build-essential libssl-dev zlib1g-dev - if [ $xxd_status == 0 ];then + elif check_sys packageManager apt && [ $xxd_status == 0 ]; then + apt-get -y update apt install -y vim-common fi fi - - - if [ ! -d 'MTProxy' ];then - git clone https://github.com/TelegramMessenger/MTProxy - fi; - cd MTProxy - make && cd objs/bin - cp -f $WORKDIR/MTProxy/objs/bin/mtproto-proxy $WORKDIR - cd $WORKDIR + if [[ "`uname -m`" != "x86_64" ]];then + if [ ! -d 'MTProxy' ];then + git clone https://github.com/TelegramMessenger/MTProxy + fi; + cd MTProxy + make && cd objs/bin + cp -f $WORKDIR/MTProxy/objs/bin/mtproto-proxy $WORKDIR + cd $WORKDIR + else + wget https://github.com/ellermister/mtproxy/releases/download/0.01/mtproto-proxy -O mtproto-proxy -q + chmod +x mtproto-proxy + fi }