Skip to content
Snippets Groups Projects
Commit 903d1575 authored by Nils Schneider's avatar Nils Schneider
Browse files

gluon-simple-tc: create initial config from site.conf

parent 7edb7754
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,13 @@ define Build/Configure
endef
define Build/Compile
$(GLUON_CONFIGURE) initial.pl > $(PKG_BUILD_DIR)/initial.sh
endef
define Package/gluon-simple-tc/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/lib/gluon/upgrade/simple-tc/initial
$(INSTALL_BIN) $(PKG_BUILD_DIR)/initial.sh $(1)/lib/gluon/upgrade/simple-tc/initial/010-site-defaults
endef
$(eval $(call BuildPackage,gluon-simple-tc))
my $cfg = $CONFIG->{simple_tc};
print <<'END';
#/bin/sh
uci -q batch <<EOF
END
while (($name, $interface) = each %{$cfg}) {
print "set gluon-simple-tc.$name=interface\n";
for (qw(ifname enabled limit_egress limit_ingress)) {
print "set gluon-simple-tc.$name.$_=$interface->{$_}\n";
}
}
print <<END;
commit gluon-simple-tc
EOF
END
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment