invariant.pl 440 B

123456789101112131415161718
  1. my $cfg = $CONFIG->{simple_tc};
  2. print "#/bin/sh\n\n";
  3. foreach my $name (sort keys %{$cfg}) {
  4. my $interface = $cfg->{$name};
  5. print "uci -q get gluon-simple-tc.$name >/dev/null || uci -q batch <<EOF\n";
  6. print "set gluon-simple-tc.$name=interface\n";
  7. for (qw(enabled ifname limit_egress limit_ingress)) {
  8. print "set gluon-simple-tc.$name.$_=$interface->{$_}\n";
  9. }
  10. print "EOF\n\n";
  11. }
  12. print "uci commit gluon-simple-tc\n";