From: Ralph Ronnquist Date: Sun, 16 Feb 2025 00:53:56 +0000 (+1100) Subject: added for sysvinit X-Git-Tag: 0.1~17 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=c468a1ac5c47c910430b207334978525a41504c7;p=rrq%2Fnfblocker.git added for sysvinit --- diff --git a/init/nfblocker b/init/nfblocker new file mode 100755 index 0000000..f6fdf59 --- /dev/null +++ b/init/nfblocker @@ -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 +}