Revert "Module Updates for 2.6.0+ (Wave 1) (#69)" (#70)

This reverts commit 0a3e973d99.
This commit is contained in:
Marc
2019-08-21 21:10:21 +01:00
committed by GitHub
parent 0a3e973d99
commit 2ba1732389
68 changed files with 445 additions and 289 deletions

View File

@@ -1,5 +1,8 @@
<?php namespace pineapple;
putenv('LD_LIBRARY_PATH='.getenv('LD_LIBRARY_PATH').':/sd/lib:/sd/usr/lib');
putenv('PATH='.getenv('PATH').':/sd/usr/bin:/sd/usr/sbin');
class ngrep extends Module
{
public function route()
@@ -53,9 +56,9 @@ class ngrep extends Module
}
}
protected function checkDeps($dependencyName)
protected function checkDependency($dependencyName)
{
return ($this->checkDependency($dependencyName) && ($this->uciGet("ngrep.module.installed")));
return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("ngrep.module.installed")));
}
protected function getDevice()
@@ -71,7 +74,7 @@ class ngrep extends Module
private function handleDependencies()
{
if (!$this->checkDeps("ngrep")) {
if (!$this->checkDependency("ngrep")) {
$this->execBackground("/pineapple/modules/ngrep/scripts/dependencies.sh install ".$this->request->destination);
$this->response = array('success' => true);
} else {
@@ -104,7 +107,7 @@ class ngrep extends Module
private function refreshStatus()
{
if (!file_exists('/tmp/ngrep.progress')) {
if (!$this->checkDeps("ngrep")) {
if (!$this->checkDependency("ngrep")) {
$installed = false;
$install = "Not installed";
$installLabel = "danger";
@@ -144,7 +147,7 @@ class ngrep extends Module
private function refreshOutput()
{
if ($this->checkDeps("ngrep")) {
if ($this->checkDependency("ngrep")) {
if ($this->checkRunning("ngrep")) {
$path = "/pineapple/modules/ngrep/log";