From 20c3a2de73a7b7b14db90e0f40fd7075a37c6a1c Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 28 May 2014 19:05:41 -0300 Subject: Simplify logic --- config/autoconfigbackup/autoconfigbackup.inc | 12 +++++------- config/autoconfigbackup/autoconfigbackup.xml | 2 +- config/autoconfigbackup/autoconfigbackup_backup.php | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'config/autoconfigbackup') 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 @@