Add package fff-autoconfig

This package configure the router automaticaly

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Christian Dresel 2020-12-28 10:56:29 +01:00
parent 7e552761f6
commit b94f2ee10e
4 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,32 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-autoconfig
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-autoconfig
include $(INCLUDE_DIR)/package.mk
define Package/fff-autoconfig
SECTION:=base
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken layer3 automatic ipv4 configuration
URL:=https://www.freifunk-franken.de
DEPENDS:= \
+fff-layer3-config
endef
define Package/fff-autoconfig/description
This package load automatic ipv4 over mqtt
endef
define Build/Compile
# nothing
endef
define Package/fff-autoconfig/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,fff-autoconfig))

View File

@ -0,0 +1,6 @@
if ! uci -q get fff.autol3 > /dev/null ; then
uci set fff.autol3=autol3
uci commit fff
fi
exit 0;

View File

@ -0,0 +1 @@
2-57/5 * * * * /usr/sbin/autoconfigl3

View File

@ -0,0 +1,19 @@
#!/bin/sh
for f in /usr/lib/autol3.d/*.sh; do
. /usr/lib/autol3.d/$f
if [ $? -ne 0 ]; then
debug "Error when executing subscript $f, exiting!"
exit 1
fi
done
if [ -n "$uci -q get fff.autol3.autoconfigl3" ] ; then
if yes | configure-layer3 -c; then
configure-layer3 -a
else
configure-layer3 -r
fi
uci del fff.autol3.autoconfigl3
uci commit fff
fi