Skip to content

Commit 84521fc

Browse files
committed
Update mtg version
1 parent b0235ec commit 84521fc

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

mtproxy.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ do_install() {
250250

251251
if [[ "$mtg_provider" == "mtg" ]]; then
252252
local arch=$(get_architecture)
253-
local mtg_url=https://github.com/9seconds/mtg/releases/download/v1.0.11/mtg-1.0.11-linux-$arch.tar.gz
254-
wget $mtg_url -O mtg.tar.gz
255-
tar -xzvf mtg.tar.gz mtg-1.0.11-linux-$arch/mtg --strip-components 1
253+
if [ "amd64" != "$arch" ]; then
254+
echo -e "[\033[33m提醒\033[0m] 你的系统架构不支持安装 mtg\n"
255+
exit 1
256+
fi
257+
local mtg_url="https://github.com/ellermister/mtproxy/releases/download/v0.04/mtg"
258+
wget $mtg_url -O mtg
259+
chmod +x mtg
256260

257261
[[ -f "./mtg" ]] && ./mtg && echo "Installed for mtg"
258262
else
@@ -297,10 +301,15 @@ do_check_system_datetime_and_update() {
297301
}
298302

299303
do_install_basic_dep() {
304+
echo -e "[\033[33m提醒\033[0m] 正在检测并安装基础依赖...\n"
300305
if check_sys packageManager yum; then
301-
yum install -y iproute curl wget procps-ng.x86_64 net-tools ntp
306+
yum update && yum install -y iproute curl wget procps-ng.x86_64 net-tools ntp
302307
elif check_sys packageManager apt; then
303-
apt install -y iproute2 curl wget procps net-tools ntpdate
308+
apt update
309+
# 先安装必需的包
310+
apt install -y iproute2 curl wget procps net-tools || true
311+
# 尝试安装时间同步工具(可选,允许失败)
312+
apt install -y ntpsec-ntpdate 2>/dev/null || apt install -y ntpdate 2>/dev/null || true
304313
fi
305314

306315
return 0
@@ -481,7 +490,7 @@ function get_run_command(){
481490

482491
# ./mtg simple-run -n 1.1.1.1 -t 30s -a 512kib 0.0.0.0:$port $client_secret >/dev/null 2>&1 &
483492
[[ -f "./mtg" ]] || (echo -e "提醒:\033[33m MTProxy 代理程序不存在请重新安装! \033[0m" && exit 1)
484-
echo "./mtg run $client_secret $proxy_tag -b 0.0.0.0:$port --multiplex-per-connection 500 --prefer-ip=ipv6 -t $local_ip:$web_port" -4 "$public_ip:$port"
493+
echo "./mtg run $client_secret $proxy_tag -b 0.0.0.0:$port --multiplex-per-connection 500 --prefer-ip=ipv4 -t $local_ip:$web_port" -4 "$public_ip:$port"
485494
else
486495
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
487496
curl -s https://core.telegram.org/getProxySecret -o proxy-secret

0 commit comments

Comments
 (0)