mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 15:45:13 +08:00
🎈 Sync 2026-04-02 20:31:34
This commit is contained in:
1 parent
020b4e1dc3
commit
a794220143
32 files changed
+1032
-531
No files matched your search
@@ -300,6 +300,10 @@ load_acl() {
|
||||
local gateway device
|
||||
network_get_gateway gateway "${interface}"
|
||||
network_get_device device "${interface}"
|
||||
# network_get_device returns empty for non-UP interfaces (e.g. auto='0').
|
||||
# Try ubus directly, then check if the name is a kernel device.
|
||||
[ -z "${device}" ] && device=$(ubus call "network.interface.${interface}" status 2>/dev/null | jsonfilter -e '@.device' 2>/dev/null)
|
||||
[ -z "${device}" ] && [ -d "/sys/class/net/${interface}" ] && device="${interface}"
|
||||
[ -z "${device}" ] && device="${interface}"
|
||||
_ipt_source="-i ${device} "
|
||||
msg=$(i18n "Source iface [%s]," "${device}")
|
||||
|
||||
@@ -338,6 +338,10 @@ load_acl() {
|
||||
local gateway device
|
||||
network_get_gateway gateway "${interface}"
|
||||
network_get_device device "${interface}"
|
||||
# network_get_device returns empty for non-UP interfaces (e.g. auto='0').
|
||||
# Try ubus directly, then check if the name is a kernel device.
|
||||
[ -z "${device}" ] && device=$(ubus call "network.interface.${interface}" status 2>/dev/null | jsonfilter -e '@.device' 2>/dev/null)
|
||||
[ -z "${device}" ] && [ -d "/sys/class/net/${interface}" ] && device="${interface}"
|
||||
[ -z "${device}" ] && device="${interface}"
|
||||
_ipt_source="iifname ${device} "
|
||||
msg=$(i18n "Source iface [%s]," "${device}")
|
||||
|
||||
@@ -348,6 +348,8 @@ add_ip2route() {
|
||||
local gateway device
|
||||
network_get_gateway gateway "$2"
|
||||
network_get_device device "$2"
|
||||
[ -z "${device}" ] && device=$(ubus call "network.interface.$2" status 2>/dev/null | jsonfilter -e '@.device' 2>/dev/null)
|
||||
[ -z "${device}" ] && [ -d "/sys/class/net/$2" ] && device="$2"
|
||||
[ -z "${device}" ] && device="$2"
|
||||
|
||||
if [ -n "${gateway}" ]; then
|
||||
|
||||
Reference in new issue
Block a user