更新超级拨号插件

This commit is contained in:
ling 2024-04-11 13:19:39 +08:00
parent 70b49ee185
commit cee7437154
3 changed files with 21 additions and 15 deletions

View File

@ -33,7 +33,7 @@ if device_suggestions then
end
end
apn = s:taboption(Value, "apn", translate("APN"))
apn = s:option(Value, "apn", translate("APN"))
apn.default = ""
apn.rmempty = true
apn:value("", translate("Auto Choose"))
@ -43,7 +43,7 @@ apn:value("ctnet", translate("China Telecom"))
apn:value("cbnet", translate("China Broadcast"))
apn:value("5gscuiot", translate("Skytone"))
auth = s:taboption("advanced", ListValue, "auth", translate("Authentication Type"))
auth = s:option(ListValue, "auth", translate("Authentication Type"))
auth.default = "none"
auth.rmempty = false
auth:value("none", translate("NONE"))
@ -51,13 +51,13 @@ auth:value("both", translate("PAP/CHAP (both)"))
auth:value("pap", "PAP")
auth:value("chap", "CHAP")
username = s:taboption("advanced", Value, "username", translate("PAP/CHAP Username"))
username = s:option(Value, "username", translate("PAP/CHAP Username"))
username.rmempty = true
username:depends("auth", "both")
username:depends("auth", "pap")
username:depends("auth", "chap")
password = s:taboption("advanced", Value, "password", translate("PAP/CHAP Password"))
password = s:option(Value, "password", translate("PAP/CHAP Password"))
password.rmempty = true
password.password = true
password:depends("auth", "both")

View File

@ -12,10 +12,10 @@ source "/usr/share/modem/modem_util.sh"
#始终确保存在运行目录
mkdir -m 0755 -p "${MODEM_RUNDIR}"
初始化模组配置
[[ "${INTERFACE}" = *"ip6tnl0"* ]] && {
sh "${SCRIPT_DIR}/modem_init.sh"
}
#初始化模组配置
# [[ "${INTERFACE}" = *"ip6tnl0"* ]] && {
# sh "${SCRIPT_DIR}/modem_init.sh"
# }
if [[ "${INTERFACE}" = *"usb"* ]] || [[ "${INTERFACE}" = *"wwan"* ]] || [[ "${INTERFACE}" = *"eth"* ]]; then
#配置网络设备

View File

@ -241,10 +241,14 @@ m_set_modem_hardware_config()
# fi
# }
#判断路径是否带有usb排除其他eth网络设备
if [ "$data_interface" != "pcie" ] && [[ "$device_physical_path" != *"usb"* ]]; then
return
fi
#是否是第一次添加(初始化模组)
local count=$(grep -o "processed" ${MODEM_PHYSICAL_DEVICE_CACHE} | wc -l)
[ "$count" -le "0" ] && {
sh "${SCRIPT_DIR}/modem_init.sh"
}
#设置物理路径状态
m_set_physical_path_status "${physical_path}" "processed"
#获取模组序号
local modem_no=$(uci -q get modem.@global[0].modem_number)
@ -258,9 +262,6 @@ m_set_modem_hardware_config()
uci set modem.modem${modem_no}.path="${physical_path}"
uci commit modem
#设置物理路径状态
m_set_physical_path_status "${physical_path}" "processed"
}
#删除模组配置
@ -781,6 +782,11 @@ m_set_network_device()
local count=$(echo "${network_path}" | grep -o "/net" | wc -l)
[ "$count" -ge "2" ] && return
#判断路径是否带有usb排除其他eth网络设备
if [[ "$network" = *"eth"* ]] && [[ "$network_path" != *"usb"* ]]; then
return
fi
#上报事件
m_report_event "${action}" "net" "${network}" "${network_path}"