aboutsummaryrefslogtreecommitdiffstats
path: root/config/pfblockerng/pfblockerng.inc
diff options
context:
space:
mode:
authorBBcan177 <bbcan177@gmail.com>2015-02-22 19:51:51 -0500
committerBBcan177 <bbcan177@gmail.com>2015-02-22 19:51:51 -0500
commitcbdace7e8760f5ff5407f484c968cfd5d4656cee (patch)
treeffbbe71b333188d09a942c6e5dd359936099c2b0 /config/pfblockerng/pfblockerng.inc
parent4a1c359d46f21af9cb7871791614ca15a2f3da9d (diff)
downloadpfsense-packages-cbdace7e8760f5ff5407f484c968cfd5d4656cee.tar.gz
pfsense-packages-cbdace7e8760f5ff5407f484c968cfd5d4656cee.tar.bz2
pfsense-packages-cbdace7e8760f5ff5407f484c968cfd5d4656cee.zip
pfBlockerNG - Mods for Nano Aliastables ro/rw
Add RW/RO commands for Aliastables Archiving for Nano/Ramdisk Installs.
Diffstat (limited to 'config/pfblockerng/pfblockerng.inc')
-rw-r--r--config/pfblockerng/pfblockerng.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc
index 78622631..6ee9592a 100644
--- a/config/pfblockerng/pfblockerng.inc
+++ b/config/pfblockerng/pfblockerng.inc
@@ -343,10 +343,11 @@ function pfb_aliastables($mode) {
// Only Execute function if Platform is NanoBSD or Ramdisks are used.
if (($g['platform'] != "pfSense") || isset($config['system']['use_mfs_tmpvar'])) {
+ conf_mount_rw();
if ($mode == "update") {
// Archive Aliastable Folder
exec ("cd {$pfb['aliasdir']}; ls -A pfB_*.txt && /usr/bin/tar -jcvf {$pfb['aliasarchive']} pfB_*.txt >/dev/null 2>&1");
- $msg = "\n\nArchiving Aliastable Folder";
+ $msg = "\n\nArchiving Aliastable Folder\n";
}
elseif ($mode == "conf") {
// Check conf file for earlyshellcmd
@@ -362,10 +363,16 @@ function pfb_aliastables($mode) {
$msg = "\n** Adding earlyshellcmd **\n";
}
}
+ conf_mount_ro();
}
else {
- // Remove Aliastables archive and earlyshellcmd if found.
- @unlink_if_exists("{$pfb['aliasarchive']}");
+ if (file_exists("{$pfb['aliasarchive']}")) {
+ // Remove Aliastables archive if found.
+ conf_mount_rw();
+ @unlink_if_exists("{$pfb['aliasarchive']}");
+ conf_mount_ro();
+ }
+ // Remove earlyshellcmd if found.
if (is_array($config['system']['earlyshellcmd'])) {
$a_earlyshellcmd = &$config['system']['earlyshellcmd'];
if (preg_grep("/pfblockerng.sh aliastables/", $a_earlyshellcmd)) {
@@ -2231,6 +2238,7 @@ function sync_package_pfblockerng($cron = "") {
unset ($other_rules,$fother_rules,$permit_rules,$fpermit_rules,$match_rules,$fmatch_rules);
}
+
#################################
# Closing Processes #
#################################