From 7dde365ca4781ec6651345f4681bef449eeeddbc Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 30 Jul 2009 10:45:34 -0300 Subject: Check if file exists before unlink --- usr/local/www/system_firmware_auto.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php index b4ad6e9..25bad20 100755 --- a/usr/local/www/system_firmware_auto.php +++ b/usr/local/www/system_firmware_auto.php @@ -158,7 +158,8 @@ else if (($sigchk == 3) || ($sigchk == 4)) if (!verify_gzip_file("/tmp/latest.tgz")) { update_status("The image file is corrupt."); update_output_window("Update cannot continue"); - unlink("{$g['upload_path']}/latest.tgz"); + if (file_exists("{$g['upload_path']}/latest.tgz")) + unlink("{$g['upload_path']}/latest.tgz"); require("fend.inc"); exit; } @@ -166,7 +167,8 @@ if (!verify_gzip_file("/tmp/latest.tgz")) { if ($sigchk) { update_status($sig_warning); update_output_window("Update cannot continue"); - unlink("{$g['upload_path']}/latest.tgz"); + if (file_exists("{$g['upload_path']}/latest.tgz")) + unlink("{$g['upload_path']}/latest.tgz"); require("fend.inc"); exit; } -- cgit v1.1