From 799dc834e0fe94ed62c0d6bb65e6d15a639ab668 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Sat, 12 Jul 2025 07:52:42 +0100 Subject: initial commit --- pf.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pf.sh (limited to 'pf.sh') diff --git a/pf.sh b/pf.sh new file mode 100644 index 0000000..f647360 --- /dev/null +++ b/pf.sh @@ -0,0 +1,20 @@ +# This source code is released into the public domain. +# +# The pf file is just a list of prefixes, so there's no formatting to do. + +PF_FILE="/etc/pf.lf-networks" + +if [ ! -f "$PF_FILE" ]; then + exit 0 +fi + +if cmp -s "$NETWORKS_FILE" "$PF_FILE"; then + exit 0 +fi + +printf '%s updated:\n\n' "$PF_FILE" +diff "$PF_FILE" "$NETWORKS_FILE" +printf '\n' + +cp "$NETWORKS_FILE" "$PF_FILE" +/etc/rc.d/pf reload -- cgit v1.2.3