aboutsummaryrefslogtreecommitdiffstats
path: root/config/autoconfigbackup
diff options
context:
space:
mode:
Diffstat (limited to 'config/autoconfigbackup')
-rw-r--r--config/autoconfigbackup/autoconfigbackup.inc12
-rw-r--r--config/autoconfigbackup/autoconfigbackup.xml2
-rw-r--r--config/autoconfigbackup/autoconfigbackup_backup.php2
3 files changed, 7 insertions, 9 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 d712d11b..b0514e6a 100644
--- a/config/autoconfigbackup/autoconfigbackup.xml
+++ b/config/autoconfigbackup/autoconfigbackup.xml
@@ -145,7 +145,7 @@
<custom_php_resync_config_command>
<![CDATA[
conf_mount_rw();
- file_put_contents("/cf/conf/lastpfSbackup.txt", "");
+ @unlink("/cf/conf/lastpfSbackup.txt");
conf_mount_ro();
if(!function_exists("filter_configure"))
require_once("filter.inc");
diff --git a/config/autoconfigbackup/autoconfigbackup_backup.php b/config/autoconfigbackup/autoconfigbackup_backup.php
index 78677049..7a6b045f 100644
--- a/config/autoconfigbackup/autoconfigbackup_backup.php
+++ b/config/autoconfigbackup/autoconfigbackup_backup.php
@@ -49,7 +49,7 @@ if($_POST) {
write_config("Backup invoked via Auto Config Backup.");
$config = parse_config(true);
conf_mount_rw();
- file_put_contents("/cf/conf/lastpfSbackup.txt", "");
+ @unlink("/cf/conf/lastpfSbackup.txt", "");
conf_mount_ro();
upload_config($_REQUEST['reason']);
$savemsg = "Backup completed successfully.";