aboutsummaryrefslogtreecommitdiffstats
path: root/config/pfblockerng/pfblockerng.sh
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-04-23 08:36:05 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-04-23 08:36:05 -0300
commit3def54fa50ce6050c0bb2e12e7c4a115266c4018 (patch)
tree123e21583ccfc10e57fbdc63916a9c7ccad2a904 /config/pfblockerng/pfblockerng.sh
parent799a01526591806f344e56556e21106130ec01df (diff)
downloadpfsense-packages-3def54fa50ce6050c0bb2e12e7c4a115266c4018.tar.gz
pfsense-packages-3def54fa50ce6050c0bb2e12e7c4a115266c4018.tar.bz2
pfsense-packages-3def54fa50ce6050c0bb2e12e7c4a115266c4018.zip
Add run_depends and port_category to pfBlockerNG, also teach it to deal with non-PBI paths
Diffstat (limited to 'config/pfblockerng/pfblockerng.sh')
-rw-r--r--config/pfblockerng/pfblockerng.sh20
1 files changed, 14 insertions, 6 deletions
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