diff options
Diffstat (limited to 'config/autoconfigbackup')
-rw-r--r-- | config/autoconfigbackup/autoconfigbackup.inc | 12 | ||||
-rw-r--r-- | config/autoconfigbackup/autoconfigbackup.xml | 6 | ||||
-rw-r--r-- | config/autoconfigbackup/autoconfigbackup_backup.php | 4 |
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; |