consolidate code

This commit is contained in:
dmacias72 2016-10-08 16:08:30 -06:00
parent cfb8b93b43
commit 275d62c468

View File

@ -139,15 +139,15 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
}else{ }else{
if ($pkg_pref == 'yes'){ if ($pkg_pref == 'yes'){
if (file_exists($pkg_file)){ if (file_exists($pkg_file)){
if (file_check_sha1($pkg_file, $pkg_sha1)) if (file_check_sha1($pkg_file, $pkg_sha1)){
$pkg_msg = 'package up to date, checksum ok.'; $pkg_msg = 'package up to date, checksum ok.';
else{ }else{
if (file_exists($pkg_file))
unlink($pkg_file); unlink($pkg_file);
$pkg_msg = 'checksum failed! package deleted.'; $pkg_msg = 'checksum failed! package deleted.';
} }
}else }else{
$pkg_msg = ' package missing!'; $pkg_msg = ' package missing!';
}
logger($pkg_name." $pkg_msg", $argq); logger($pkg_name." $pkg_msg", $argq);
} }