summaryrefslogtreecommitdiffstats
path: root/pf.sh
blob: f6473601f594cc3fc51d5ea93802128c267a3563 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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