mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 11:45:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
. /lib/netifd/netifd-proto.sh
|
||||
|
||||
|
||||
find_xmm_iface() {
|
||||
local cfg="$1"
|
||||
local proto section
|
||||
|
||||
config_get proto "$cfg" proto
|
||||
[ "$proto" = xmm ] || return 0
|
||||
|
||||
local dev=$(uci_get network "$cfg" device)
|
||||
local devname=$(basename $dev)
|
||||
|
||||
if ! [ -e "/sys/${DEVPATH}" ]; then
|
||||
if ! [ -e "/sys/class/tty/${devname}" ]; then
|
||||
if [ "$ACTION" = remove ]; then
|
||||
proto_set_available "$cfg" 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -e "/sys/${DEVPATH}" ]; then
|
||||
if [ -e "/sys/class/tty/${devname}" ]; then
|
||||
if [ "$ACTION" = add ]; then
|
||||
proto_set_available "$cfg" 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
[ "$ACTION" = add ] || [ "$ACTION" = remove ] || exit 0
|
||||
|
||||
config_load network
|
||||
config_foreach find_xmm_iface interface
|
||||
Reference in new issue
Block a user