mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix merge
This commit is contained in:
commit
8e9389f476
160 changed files with 26795 additions and 3701 deletions
|
@ -6,6 +6,8 @@ START=5
|
|||
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
omr_intf_del() {
|
||||
[ -z "$1" ] && return
|
||||
uci -q delete openmptcprouter.$1
|
||||
|
@ -18,11 +20,14 @@ omr_intf_check() {
|
|||
omr_intf_set() {
|
||||
local device
|
||||
local ifname
|
||||
config_get device "$1" device
|
||||
config_get type "$1" type
|
||||
|
||||
ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device ifname $1
|
||||
[ -z "$ifname" ] && network_get_physdev ifname $1
|
||||
[ -z "$ifname" ] && config_get ifname "$1" device
|
||||
[ -z "$ifname" ] && config_get ifname "$1" ifname
|
||||
[ -z "$ifname" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
#config_get devicename "$1" _modem_device
|
||||
devicename=${ifname}
|
||||
config_get type "$1" type
|
||||
|
||||
if [ "$type" != "macvlan" ] && [ -n "$ifname" ] && [ -f /sys/class/net/${ifname}/device/uevent ]; then
|
||||
devicepath=$(readlink -f /sys/class/net/${ifname})
|
||||
|
@ -38,7 +43,7 @@ omr_intf_set() {
|
|||
uci -q delete network.$1.modalias
|
||||
uci -q delete network.$1.product
|
||||
fi
|
||||
elif [ "$type" != "macvlan" ] && [ -n "$device" ] && [ -f /sys/bus/usb-serial/devices/${devicename}/device/uevent ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" != "" ]; then
|
||||
elif [ "$type" != "macvlan" ] && [ -n "$devicename" ] && [ -f /sys/bus/usb-serial/devices/${devicename}/device/uevent ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" != "" ]; then
|
||||
mac=""
|
||||
if [ -f /sys/class/net/${ifname}/address ]; then
|
||||
mac="$(cat /sys/class/net/${ifname}/address | tr -d '\n')"
|
||||
|
@ -56,6 +61,10 @@ omr_set_settings() {
|
|||
local ifname
|
||||
local multipath
|
||||
config_get multipath "$1" multipath
|
||||
network_get_device ifname $1
|
||||
[ -z "$ifname" ] && network_get_physdev ifname $1
|
||||
[ -z "$ifname" ] && config_get ifname "$1" device
|
||||
[ -z "$ifname" ] && config_get ifname "$1" ifname
|
||||
config_get device "$1" device
|
||||
config_get proto "$1" proto
|
||||
config_get type "$1" type
|
||||
|
@ -144,15 +153,13 @@ start_service() {
|
|||
del_list dhcp.@dnsmasq[0].server='127.0.0.1#5353'
|
||||
add_list dhcp.@dnsmasq[0].server='114.114.114.114'
|
||||
set dhcp.@dnsmasq[0].dnsseccheckunsigned='0'
|
||||
delete dhcp.@dnsmasq[0].dnssec='1'
|
||||
delete dhcp.@dnsmasq[0].dnssec
|
||||
commit dhcp
|
||||
EOF
|
||||
elif [ "$(uci -q get openmptcprouter.settings.country)" = "world" ] && [ -n "$(uci -q get dhcp.@dnsmasq[0].server | grep '114.114.114.114')" ]; then
|
||||
uci -q batch <<-EOF > /dev/null
|
||||
add_list dhcp.@dnsmasq[0].server='127.0.0.1#5353'
|
||||
del_list dhcp.@dnsmasq[0].server='114.114.114.114'
|
||||
set dhcp.@dnsmasq[0].dnsseccheckunsigned='1'
|
||||
set dhcp.@dnsmasq[0].dnssec='1'
|
||||
commit dhcp
|
||||
EOF
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue