GetNodes(array(intval($_REQUEST['node_id']))); if (!empty($nodes)) { $node = $nodes[0]; } else { exit(1); } if ( count($node['nodegroup_ids']) > 0 ) { // collect a list of all nodegroup names for this node. foreach ( $node['nodegroup_ids'] as $ng_id ) { $ngs = $adm->GetNodeGroups(array('nodegroup_id' => $ng_id)); if (!empty($ngs)) { logit($ngs[0]['groupname']); $ng_names[] = $ngs[0]['groupname']; } } } else { $ng_names[] = "default"; } } foreach ( $ng_names as $name ) { logit("name: " . $name); // check that directory exists $file= "hotfixes/$name.tar"; $stat = stat($file); if ( !empty ($stat) ) { // send to client readfile($file); // stop after the first match. exit(1); } } ?>