aboutsummaryrefslogtreecommitdiffstats
path: root/roles/security/files/600.clean-pf
blob: 9ecf42ca3b3e0654be841746cdc47bed5973e185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
#
# Clean up PF tables ...
#

if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

case "$daily_clean_pf_enable" in
    [Yy][Ee][Ss])
	echo ""
	echo "PF tables cleanup:"
        : ${daily_clean_pf_expire:=86400}
        for table in $daily_clean_pf_tables; do
            echo "Cleanup table $table ..."
	    pfctl -v -t $table -T expire $daily_clean_pf_expire
            rc=$?
        done
        ;;
    *)
        rc=0
        ;;
esac

exit $rc