summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/etc/network/if-up.d/000firewall
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-includes/etc/network/if-up.d/000firewall')
-rwxr-xr-xconfig/chroot_local-includes/etc/network/if-up.d/000firewall12
1 files changed, 12 insertions, 0 deletions
diff --git a/config/chroot_local-includes/etc/network/if-up.d/000firewall b/config/chroot_local-includes/etc/network/if-up.d/000firewall
new file mode 100755
index 0000000..f57681e
--- /dev/null
+++ b/config/chroot_local-includes/etc/network/if-up.d/000firewall
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Exit if lo interface
+[ "$METHOD" = "loopback" ] && exit 0
+
+IPTABLES_RULES=/etc/firewall.conf
+
+[ -x /sbin/iptables-restore ] || exit 2
+[ -n "$IPTABLES_RULES" ] || exit 3
+[ -r "$IPTABLES_RULES" ] || exit 4
+
+/sbin/iptables-restore < "$IPTABLES_RULES"