File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,17 @@ set_config(){
22
22
sed -i ' s/proxy_tag="[0-9A-Za-z]*"/proxy_tag="' $tag ' "/' $mtp_config
23
23
fi
24
24
if [ " $domain " ]; then
25
- sed -i ' s/domain="[A-z\.\-\d]*"/domain="' $domain ' "/' $mtp_config
25
+ sed -i ' s/domain="[A-z\.\-0-9]*"/domain="' $domain ' "/' $mtp_config
26
+ fi
27
+ if [ " $provider " ] && [[ " $provider " =~ ^[1-2]$ ]]; then
28
+ sed -i ' s/provider=[0-9]\+/provider=' $provider ' /' $mtp_config
26
29
fi
27
30
}
28
31
29
32
if [ ! -f $mtp_config ]; then
30
33
cp " ${default_config} " " $mtp_config "
31
34
35
+ # if params is empty, then generate random values
32
36
if [ ! " $secret " ]; then
33
37
secret=$( gen_rand_hex 32)
34
38
fi
@@ -42,14 +46,11 @@ if [ ! -f $mtp_config ];then
42
46
fi
43
47
44
48
echo $ip_white_list > /var/ip_white_list
45
- set_config
46
49
fi ;
47
50
48
51
set_config
49
52
echo " =================================================="
50
53
echo -e " Default port is \033[31m443\033[0m by docker started mtproxy!!!"
51
54
echo " =================================================="
52
55
cd /home/mtproxy
53
- curl -s https://core.telegram.org/getProxySecret -o proxy-secret
54
- curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
55
56
bash /home/mtproxy/mtproxy.sh start
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ function get_run_command(){
427
427
428
428
# ./mtg simple-run -n 1.1.1.1 -t 30s -a 512kib 0.0.0.0:$port $client_secret >/dev/null 2>&1 &
429
429
[[ -f " ./mtg" ]] || (echo -e " 提醒:\033[33m MTProxy 代理程序不存在请重新安装! \033[0m" && exit 1)
430
- echo " ./mtg run $client_secret $proxy_tag -b 0.0.0.0:$port --multiplex-per-connection 500 --prefer-ip=ipv6 -t $local_ip :3129 "
430
+ 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 "
431
431
else
432
432
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
433
433
curl -s https://core.telegram.org/getProxySecret -o proxy-secret
You can’t perform that action at this time.
0 commit comments