mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-16 21:43:33 +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
@@ -285,6 +285,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="源接口【${device}】,"
|
||||
|
||||
@@ -326,6 +326,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="源接口【${device}】,"
|
||||
|
||||
@@ -395,6 +395,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