From 3def54fa50ce6050c0bb2e12e7c4a115266c4018 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 23 Apr 2015 08:36:05 -0300 Subject: Add run_depends and port_category to pfBlockerNG, also teach it to deal with non-PBI paths --- config/pfblockerng/pfblockerng.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'config/pfblockerng/pfblockerng.sh') diff --git a/config/pfblockerng/pfblockerng.sh b/config/pfblockerng/pfblockerng.sh index e010a6e5..ba0c908b 100644 --- a/config/pfblockerng/pfblockerng.sh +++ b/config/pfblockerng/pfblockerng.sh @@ -13,12 +13,20 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +pfs_version=$(cat /etc/version | cut -c 1-3) + +if [ "${pfs_version}" = "2.2" ]; then + mtype=$(/usr/bin/uname -m) + prefix="/usr/pbi/pfblockerng-${mtype}" +else + prefix="/usr/local" +fi + now=$(/bin/date +%m/%d/%y' '%T) -mtype=$(/usr/bin/uname -m); # Application Paths -pathgrepcidr="/usr/pbi/pfblockerng-$mtype/bin/grepcidr" -pathgeoip="/usr/pbi/pfblockerng-$mtype/bin/geoiplookup" +pathgrepcidr="${prefix}/bin/grepcidr" +pathgeoip="${prefix}/bin/geoiplookup" pathtar=/usr/bin/tar pathgunzip=/usr/bin/gunzip @@ -35,8 +43,8 @@ etblock=$(echo $8 | sed 's/,/, /g') etmatch=$(echo $9 | sed 's/,/, /g') # File Locations -aliasarchive="/usr/pbi/pfblockerng-$mtype/etc/aliastables.tar.bz2" -pathgeoipdat=/usr/pbi/pfblockerng-$mtype/share/GeoIP/GeoIP.dat +aliasarchive="${prefix}/etc/aliastables.tar.bz2" +pathgeoipdat="${prefix}/share/GeoIP/GeoIP.dat" pfbsuppression=/var/db/pfblockerng/pfbsuppression.txt masterfile=/var/db/pfblockerng/masterfile mastercat=/var/db/pfblockerng/mastercat @@ -968,4 +976,4 @@ case $1 in exitnow ;; esac -exitnow \ No newline at end of file +exitnow -- cgit v1.2.3