aboutsummaryrefslogtreecommitdiffstats
path: root/config/autoconfigbackup
diff options
context:
space:
mode:
authorMartin Fuchs <trendchiller@users.noreply.github.com>2014-06-10 15:48:33 +0200
committerMartin Fuchs <trendchiller@users.noreply.github.com>2014-06-10 15:48:33 +0200
commit0ef20f92b5bea3d3487c249d515f905d09f859a7 (patch)
tree76101c20efe2f68b0f455070f1f077058e52868d /config/autoconfigbackup
parentff5060af8732ef9bd55a95537f3705c7382e19e0 (diff)
parentb2bea6eac166ab17ed1e5776ea32d822f459a914 (diff)
downloadpfsense-packages-0ef20f92b5bea3d3487c249d515f905d09f859a7.tar.gz
pfsense-packages-0ef20f92b5bea3d3487c249d515f905d09f859a7.tar.bz2
pfsense-packages-0ef20f92b5bea3d3487c249d515f905d09f859a7.zip
Merge pull request #1 from pfsense/master
update fork
Diffstat (limited to 'config/autoconfigbackup')
-rw-r--r--config/autoconfigbackup/autoconfigbackup.inc12
-rw-r--r--config/autoconfigbackup/autoconfigbackup.xml6
-rw-r--r--config/autoconfigbackup/autoconfigbackup_backup.php4
3 files changed, 12 insertions, 10 deletions
diff --git a/config/autoconfigbackup/autoconfigbackup.inc b/config/autoconfigbackup/autoconfigbackup.inc
index f67191ae..0ca3ebe9 100644
--- a/config/autoconfigbackup/autoconfigbackup.inc
+++ b/config/autoconfigbackup/autoconfigbackup.inc
@@ -130,13 +130,11 @@ function upload_config($reasonm = "") {
}
// Define some needed variables
- if(!file_exists("/cf/conf/lastpfSbackup.txt")) {
- conf_mount_rw();
- touch("/cf/conf/lastpfSbackup.txt");
- conf_mount_ro();
- }
+ if(file_exists("/cf/conf/lastpfSbackup.txt"))
+ $last_backup_date = str_replace("\n", "", file_get_contents("/cf/conf/lastpfSbackup.txt"));
+ else
+ $last_backup_date = "";
- $last_backup_date = str_replace("\n", "", file_get_contents("/cf/conf/lastpfSbackup.txt"));
$last_config_change = $config['revision']['time'];
$hostname = $config['system']['hostname'] . "." . $config['system']['domain'];
if($reasonm)
@@ -241,4 +239,4 @@ function upload_config($reasonm = "") {
}
}
-?> \ No newline at end of file
+?>
diff --git a/config/autoconfigbackup/autoconfigbackup.xml b/config/autoconfigbackup/autoconfigbackup.xml
index 1e5d44c1..b0514e6a 100644
--- a/config/autoconfigbackup/autoconfigbackup.xml
+++ b/config/autoconfigbackup/autoconfigbackup.xml
@@ -37,7 +37,7 @@
<description>Automatically backs up your pfSense configuration. All contents are encrypted on the server. Requires Gold or Support Subscription from https://portal.pfsense.org</description>
<requirements>pfSense Portal subscription</requirements>
<name>AutoConfigBackup</name>
- <version>1.24</version>
+ <version>1.25</version>
<title>Diagnostics: Auto Configuration Backup</title>
<savetext>Change</savetext>
<include_file>/usr/local/pkg/autoconfigbackup.inc</include_file>
@@ -144,7 +144,9 @@
</custom_php_validation_command>
<custom_php_resync_config_command>
<![CDATA[
- exec("echo > /cf/conf/lastpfSbackup.txt");
+ conf_mount_rw();
+ @unlink("/cf/conf/lastpfSbackup.txt");
+ conf_mount_ro();
if(!function_exists("filter_configure"))
require_once("filter.inc");
filter_configure();
diff --git a/config/autoconfigbackup/autoconfigbackup_backup.php b/config/autoconfigbackup/autoconfigbackup_backup.php
index a65fba4d..7a6b045f 100644
--- a/config/autoconfigbackup/autoconfigbackup_backup.php
+++ b/config/autoconfigbackup/autoconfigbackup_backup.php
@@ -48,7 +48,9 @@ if($_POST) {
else
write_config("Backup invoked via Auto Config Backup.");
$config = parse_config(true);
- exec("echo > /cf/conf/lastpfSbackup.txt");
+ conf_mount_rw();
+ @unlink("/cf/conf/lastpfSbackup.txt", "");
+ conf_mount_ro();
upload_config($_REQUEST['reason']);
$savemsg = "Backup completed successfully.";
$donotshowheader=true;