added lang /lib pkgs
[librewrt/.git] / packages / xwrt / webif / files / etc / init.d / webiffirewalllog
1 #!/bin/sh /etc/rc.common
2
3 START=90
4
5 start() {
6 . /lib/config/uci.sh
7 . /usr/lib/webif/functions.sh
8         uci_load "webif"
9         config_get enabled firewall log
10         if [ "$enabled" = "1" ]; then
11                 iptables -A input_rule -j LOG --log-prefix "input_rule:DROP "
12                 iptables -A forwarding_rule -j LOG --log-prefix "forwarding_rule:DROP "
13                 iptables -A output_rule -j LOG --log-prefix "output_rule:DROP "
14         fi
15 }
16
17 stop() {
18         iptables -D input_rule -j LOG --log-prefix "input_rule:DROP "
19         iptables -D forwarding_rule -j LOG --log-prefix "forwarding_rule:DROP "
20         iptables -D output_rule -j LOG --log-prefix "output_rule:DROP "
21 }