Skip to content

Commit

Permalink
gluon-mesh-batman-adv: remove remaining deprecated sysfs usage
Browse files Browse the repository at this point in the history
While we're at it, also slightly optimize proto_gluon_bat0_renew.
  • Loading branch information
neocturne committed Nov 24, 2019
1 parent f715a58 commit b4101e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/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
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b4101e5

Please sign in to comment.