Merge pull request #13 from sfwtw/main

This commit is contained in:
Fu Jianrong 2025-01-24 22:54:01 +08:00 committed by GitHub
commit 71315c9ba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -270,7 +270,7 @@ check_ip()
;;
"mediatek")
check_ip_command="AT+CGPADDR=3"
check_ipv6=1
mtk=1
stric=1
;;
esac
@ -278,7 +278,7 @@ check_ip()
esac
ipaddr=$(at "$at_port" "$check_ip_command" |grep +CGPADDR:)
if [ -n "$ipaddr" ];then
if [ "$check_ipv6" = "1" ] && [ "$pdp_type" = "IPv4v6" ];then
if [ $mtk -eq 1 ] && [ "$pdp_type" = "IPv4v6" ];then
if ! ping -c 2 -w 5 2400:3200::1 > /dev/null 2>&1; then
m_debug "ipv6 is down,try to restart"
ifdown "$interface"V6 && sleep 2 && ifup "$interface"V6
@ -759,6 +759,10 @@ at_dial()
cgdcont_command="AT+CGDCONT=1,\"$pdp_type\",\"$apn\""
;;
"mediatek")
mtk=1
if [ "$apn" = "auto" ];then
apn="cbnet"
fi
at_command="AT+CGACT=1,3"
cgdcont_command="AT+CGDCONT=3,\"$pdp_type\",\"$apn\""
;;
@ -768,8 +772,13 @@ at_dial()
esac
m_debug "dialing vendor:$manufacturer;platform:$platform; $cgdcont_command ; $at_command"
at "${at_port}" "${cgdcont_command}"
sleep 3 #修复fm350拨号失败问题 ps:350处理不过来
if [ $mtk -eq 1 ];then
sleep 3
fi
at "$at_port" "$at_command"
if [ $mtk -eq 1 ];then
sleep 3
fi
}
ip_change_fm350()