Update mtproxy.sh

This commit is contained in:
chauncey 2022-04-01 12:06:44 +08:00 committed by GitHub
parent 94db725075
commit 640f3fcba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,8 +177,8 @@ config_mtp(){
done
# config info
public_ip=$(curl -s https://api.ip.sb/ip --ipv4)
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4)
public_ip=$(curl -s https://api.ip.sb/ip -A Mozilla --ipv4)
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4)
secret=$(head -c 16 /dev/urandom | xxd -ps)
# proxy tag
@ -230,8 +230,8 @@ info_mtp(){
status_mtp
if [ $? == 1 ];then
source ./mtp_config
public_ip=$(curl -s https://api.ip.sb/ip --ipv4)
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4)
public_ip=$(curl -s https://api.ip.sb/ip -A Mozilla --ipv4)
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4)
domain_hex=$(xxd -pu <<< $domain | sed 's/0a//g')
client_secret="ee${secret}${domain_hex}"
echo -e "TMProxy+TLS代理: \033[32m运行中\033[0m"
@ -255,8 +255,8 @@ run_mtp(){
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
source ./mtp_config
nat_ip=$(echo $(ip a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | cut -d "/" -f1 |awk 'NR==1 {print $1}'))
public_ip=`curl -s https://api.ip.sb/ip --ipv4`
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4)
public_ip=`curl -s https://api.ip.sb/ip -A Mozilla --ipv4`
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4)
nat_info=""
if [[ $nat_ip != $public_ip ]];then
nat_info="--nat-info ${nat_ip}:${public_ip}"
@ -275,8 +275,8 @@ debug_mtp(){
cd $WORKDIR
source ./mtp_config
nat_ip=$(echo $(ip a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | cut -d "/" -f1 |awk 'NR==1 {print $1}'))
public_ip=`curl -s https://api.ip.sb/ip --ipv4`
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4)
public_ip=`curl -s https://api.ip.sb/ip -A Mozilla --ipv4`
[ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4)
nat_info=""
if [[ $nat_ip != $public_ip ]];then
nat_info="--nat-info ${nat_ip}:${public_ip}"