From 83d01a4452074201005f3f86aadf5de7e2e4bd99 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 7 Oct 2008 02:33:55 +0000 Subject: Only set last backup time if we succeed. --- packages/autoconfigbackup/upload_config_filter.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/autoconfigbackup/upload_config_filter.php b/packages/autoconfigbackup/upload_config_filter.php index d26f697d..dfff8688 100644 --- a/packages/autoconfigbackup/upload_config_filter.php +++ b/packages/autoconfigbackup/upload_config_filter.php @@ -85,11 +85,6 @@ if(!$username or !$password or !$encryptpw) { } else { curl_close($curl_session); } - - // Update last pfS backup time - $fd = fopen("/cf/conf/lastpfSbackup.txt", "w"); - fwrite($fd, $config['revision']['time']); - fclose($fd); if(!strstr($data, "500")) { $notice_text = "An error occured while uploading your pfSense configuration to portal.pfsense.org"; @@ -97,6 +92,10 @@ if(!$username or !$password or !$encryptpw) { file_notice("autoconfigurationbackup", $notice_text, $data, ""); update_filter_reload_status($notice_text . " - " . $data); } else { + // Update last pfS backup time + $fd = fopen("/cf/conf/lastpfSbackup.txt", "w"); + fwrite($fd, $config['revision']['time']); + fclose($fd); $notice_text = "End of portal.pfsense.org configuration backup (success)."; log_error($notice_text); update_filter_reload_status($notice_text); -- cgit v1.2.3