mini_snmpd: fix initscript to use l3_device 2992/head
authorLuke McKee <hojuruku@gmail.com>
Tue, 26 Jul 2016 14:17:31 +0000 (21:17 +0700)
committerLuke McKee <hojuruku@gmail.com>
Tue, 26 Jul 2016 14:17:42 +0000 (21:17 +0700)
for working out the interface name
Working:
ubus -S call network.interface dump|jsonfilter -e "@.interface[@.interface=\"wan\"].l3_device"
Broken:
ubus -S call network.interface dump|jsonfilter -e "@.interface[@.interface=\"wan\"].device"

Fix run tested:
root@wifi:/overlay/upper# ps |grep mini_snmpd
 1404 root       980 S    /usr/bin/mini_snmpd -n -c public -L Undisclosed -C VGB <admin@victimsofgaybullying.com> -t 1 -a -d /overlay,/tmp -i br-lan,pppoe-w

Before it wasn't using the pppoe interface it was using the parent
interface eth0 twice. Small 1 line fix. Merge at your convenience.

Signed-off-by: Luke McKee <hojuruku@gmail.com>
net/mini_snmpd/Makefile
net/mini_snmpd/files/mini_snmpd.init

index 9945b8fa013cda26c0513d2d35ea0f2ae636c205..f86539a0ceb5637180a7685776a8d4d1a310f778 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mini_snmpd
 PKG_VERSION:=1.4-rc1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Luke McKee <hojuruku@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 442e350af3abb2e1c61c86103f97484114a6d35a..0fb63d4d8f222b5d4058316a4c7e41d7866969e0 100644 (file)
@@ -71,7 +71,7 @@ append_interface() {
        local name="$1" netdev netdev_count
        [ -z $netdev_count ] && netdev_count=0
        # for the purposes of snmp monitoring it doesn't need to be up, it just needs to exist in /proc/net/dev
-       netdev=$(ubus -S call network.interface dump|jsonfilter -e "@.interface[@.interface=\"$name\"].device")  
+       netdev=$(ubus -S call network.interface dump|jsonfilter -e "@.interface[@.interface=\"$name\"].l3_device")  
        if [ -n "$netdev" ] && grep -qF "$netdev" /proc/net/dev ]; then 
                [ $netdev_count -ge 4 ] && {
                        _err "$cfg: too many network interfaces configured, ignoring $name"