Skip to content
Snippets Groups Projects
Unverified Commit b4101e54 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-mesh-batman-adv: remove remaining deprecated sysfs usage

While we're at it, also slightly optimize proto_gluon_bat0_renew.
parent f715a58f
Branches
Tags
No related merge requests found
#!/bin/sh
lock /var/lock/gluon_bat0.lock
(echo 'none' > "/sys/class/net/$IFNAME/batman_adv/mesh_iface") 2>/dev/null
batctl interface del "$IFNAME" 2>/dev/null
lock -u /var/lock/gluon_bat0.lock
......@@ -22,15 +22,9 @@ proto_gluon_bat0_renew() {
lock /var/lock/gluon_bat0.lock
local ifdump="$(ubus call network.interface dump)"
echo "$ifdump" | jsonfilter \
-e "@.interface[@.proto='gluon_mesh' && @.up=true]['device','data']" \
| while read dev; do
read data
echo bat0 > "/sys/class/net/$dev/batman_adv/mesh_iface"
done
ubus call network.interface dump | jsonfilter \
-e "@.interface[@.proto='gluon_mesh' && @.up=true].device" \
| xargs -r -n 1 batctl interface add
lock -u /var/lock/gluon_bat0.lock
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment