Developing lightweight computation at the DSG edge

Commit 176a1066 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[qmp-system] Fix /etc/config/mini_snmpd to ensure that br-lan and lan are not...

[qmp-system] Fix /etc/config/mini_snmpd to ensure that br-lan and lan are not both configured, which makes the daemon not boot
parent 30800e4a
...@@ -25,12 +25,13 @@ ...@@ -25,12 +25,13 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
QMP_RELEASE?=r20170207-1 QMP_RELEASE?=r20170207-2
QMP_PKGRELEASE=r20170207-2
QMP_CODENAME?=testing QMP_CODENAME?=testing
QMP_BUILDDATE:=$(shell date +%Y%m%d-%H%M) QMP_BUILDDATE:=$(shell date +%Y%m%d-%H%M)
PKG_NAME:=qmp-system PKG_NAME:=qmp-system
PKG_VERSION:=$(QMP_RELEASE) PKG_VERSION:=$(QMP_RELEASE)-$(QMP_PKGRELEASE)
PKG_RELEASE:=$(QMP_CODENAME) PKG_RELEASE:=$(QMP_CODENAME)
PKG_LICENSE:=GPL-2.0+ PKG_LICENSE:=GPL-2.0+
......
#!/bin/sh #!/bin/sh
[ -f /etc/config/mini_snmpd ] && { [ -f /etc/config/mini_snmpd ] && {
# Enable mini_snmpd
uci set mini_snmpd.@mini_snmpd[0].enabled=1 uci set mini_snmpd.@mini_snmpd[0].enabled=1
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'br-lan|wlan0'
then # Remove br-lan from the interfaces list
local elem
local list="$(uci get mini_snmpd.@mini_snmpd[0].interfaces)"
uci delete mini_snmpd.@mini_snmpd[0].interfaces
for elem in $list; do
if [ "$elem" != "br-lan" ]; then
echo $elem
uci add_list mini_snmpd.@mini_snmpd[0].interfaces=$elem
fi
done
uci commit
# Ensure wlan0 is added
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'wlan0'; then
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="wlan0" uci add_list mini_snmpd.@mini_snmpd[0].interfaces="wlan0"
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="br-lan"
fi fi
# Ensure lan is added
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'lan'; then
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="lan"
fi
uci commit uci commit
/etc/init.d/mini_snmpd restart # Remove old items
} uci_remove_list_element "olsrd.@Interface[0].interface" "wan"
uci commit
/etc/init.d/mini_snmpd restart
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment