added for sysvinit
authorRalph Ronnquist <rrq@rrq.au>
Sun, 16 Feb 2025 00:53:56 +0000 (11:53 +1100)
committerRalph Ronnquist <rrq@rrq.au>
Sun, 16 Feb 2025 00:53:56 +0000 (11:53 +1100)
init/nfblocker [new file with mode: 0755]

diff --git a/init/nfblocker b/init/nfblocker
new file mode 100755 (executable)
index 0000000..f6fdf59
--- /dev/null
@@ -0,0 +1,21 @@
+#!/lib/init/init-d-script
+### BEGIN INIT INFO
+# Provides:          atd
+# Required-Start:    mountkernfs $local_fs
+# X-Start-Before:    $network
+# Default-Start:     S
+# Required-Stop:
+# Short-Description: Block selected HTTP and HTTPS connections
+# Description:       Firewall agent that blocks outbound connections
+#                    for selected domains
+### END INIT INFO
+DAEMON=/usr/sbin/nfblocker
+DAEMON_ARGS="$(ls /etc/nfblocker/blocked/*.acl 2>/dev/null)"
+
+do_start_prepare() {
+    iptables -I OUTPUT -p tcp -j NFQUEUE --queue-num 99
+}
+
+do_stop_prepare() {
+    iptables -D OUTPUT -p tcp -j NFQUEUE --queue-num 99
+}