diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-06 23:24:25 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-06 23:24:25 +0000 |
commit | 6f37633e9420b577e6eaa89f2c8e54761df34a9d (patch) | |
tree | bb9b0fd8aab5b6cfd7587d2e7ede01ab93a2ca22 /packages/autoconfigbackup | |
parent | f13e9ecb7275cc40b38f8c31f2f17a4906f3eee2 (diff) | |
download | pfsense-packages-6f37633e9420b577e6eaa89f2c8e54761df34a9d.tar.gz pfsense-packages-6f37633e9420b577e6eaa89f2c8e54761df34a9d.tar.bz2 pfsense-packages-6f37633e9420b577e6eaa89f2c8e54761df34a9d.zip |
Detect success, otherwise log the error and file an alert()
Diffstat (limited to 'packages/autoconfigbackup')
-rw-r--r-- | packages/autoconfigbackup/upload_config_filter.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/autoconfigbackup/upload_config_filter.php b/packages/autoconfigbackup/upload_config_filter.php index ed240749..3433dd85 100644 --- a/packages/autoconfigbackup/upload_config_filter.php +++ b/packages/autoconfigbackup/upload_config_filter.php @@ -54,6 +54,7 @@ if($last_backup_date <> $last_config_change) { curl_setopt($curl_session, CURLOPT_URL, $upload_url); curl_setopt($curl_session, CURLOPT_POST, count($post_fields)); curl_setopt($curl_session, CURLOPT_POSTFIELDS, $fields_string); + curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0); $data = curl_exec($curl_session); if (curl_errno($curl_session)) { @@ -71,7 +72,12 @@ if($last_backup_date <> $last_config_change) { fwrite($fd, $config['revision']['time']); fclose($fd); - log_error("End of portal.pfsense.org configuration backup."); + if(!strstr($data, "500")) { + log_error("An error occured while uploading your pfSense configuration to portal.pfsense.org ($data)"); + file_notice("autoconfigurationbackup", "An error occured while uploading your pfSense configuration to portal.pfsense.org", $data, ""); + } else { + log_error("End of portal.pfsense.org configuration backup (success)."); + } // Unlock config config_unlock(); |