diff --git a/app/Models/ScriptsModel.php b/app/Models/ScriptsModel.php index 549692010..da24073b1 100644 --- a/app/Models/ScriptsModel.php +++ b/app/Models/ScriptsModel.php @@ -406,26 +406,28 @@ public function download(int $id = 0): ?string } if (!empty($instance->config->executables) and $instance->config->executables) { - $sql = "SELECT * FROM executables"; - $result = $this->db->query($sql)->getResult(); - $exclusions = array(); - if (!empty($result)) { - foreach ($result as $item) { - $path = str_replace('\\', '\\\\', $item->path); - if ($item->exclude === 'n') { - $replace = $find . "\nexecutables[" . ($item->id + 1) . ']="' . $path . '"'; - $file = str_replace($find, $replace, $file); - } - if ($item->exclude === 'y') { - #$replace = $find . "\nexclusions[" . ($item->id + 1) . ']="' . $path . '"'; - #$file = str_replace($find, $replace, $file); - $exclusions[] = $path; + if ($data->based_on === 'audit_linux.sh') { + $sql = "SELECT * FROM executables"; + $result = $this->db->query($sql)->getResult(); + $exclusions = array(); + if (!empty($result)) { + foreach ($result as $item) { + $path = str_replace('\\', '\\\\', $item->path); + if ($item->exclude === 'n') { + $replace = $find . "\nexecutables[" . ($item->id + 1) . ']="' . $path . '"'; + $file = str_replace($find, $replace, $file); + } + if ($item->exclude === 'y') { + #$replace = $find . "\nexclusions[" . ($item->id + 1) . ']="' . $path . '"'; + #$file = str_replace($find, $replace, $file); + $exclusions[] = $path; + } } } - } - if (!empty($exclusions)) { - $replace = $find . "\nexclusions=\"" . implode('|', $exclusions) . "\""; - $file = str_replace($find, $replace, $file); + if (!empty($exclusions)) { + $replace = $find . "\nexclusions=\"" . implode('|', $exclusions) . "\""; + $file = str_replace($find, $replace, $file); + } } }