aboutsummaryrefslogtreecommitdiffstats
path: root/config/pfblockerng/pfblockerng.sh
diff options
context:
space:
mode:
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