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,7 +1,7 @@
<?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');
putenv('LD_LIBRARY_PATH='.getenv('LD_LIBRARY_PATH').':/sd/lib:/sd/usr/lib');
putenv('PATH='.getenv('PATH').':/sd/usr/bin:/sd/usr/sbin');
class nmap extends Module
{
@@ -44,15 +44,15 @@ class nmap extends Module
}
}
protected function checkDep($dependencyName)
protected function checkDependency($dependencyName)
{
return ($this->checkDependency($dependencyName) && ($this->uciGet("nmap.module.installed")));
return ((exec("which {$dependencyName}") == '' ? false : true) && ($this->uciGet("nmap.module.installed")));
}
// protected function getDevice()
// {
// return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'"));
// }
protected function getDevice()
{
return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'"));
}
protected function refreshInfo()
{
@@ -62,7 +62,6 @@ class nmap extends Module
private function handleDependencies()
{
error_log("handleDependencies()");
if (!$this->checkDependency("nmap")) {
$this->execBackground("/pineapple/modules/nmap/scripts/dependencies.sh install ".$this->request->destination);
$this->response = array('success' => true);
@@ -93,11 +92,9 @@ class nmap extends Module
private function togglenmap()
{
if (!$this->checkRunning("nmap")) {
error_log("nmap not running");
$full_cmd = $this->request->command . " -oN /tmp/nmap.scan 2>&1";
shell_exec("echo -e \"{$full_cmd}\" > /tmp/nmap.run");
error_log("calling run script");
$this->execBackground("/pineapple/modules/nmap/scripts/nmap.sh start");
} else {
$this->execBackground("/pineapple/modules/nmap/scripts/nmap.sh stop");

View File

@@ -1,10 +1,8 @@
#!/bin/sh
#2015 - Whistle Master
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
#export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
logger "== RUNNING NMAP INSTALL SCRIPT"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
[[ -f /tmp/nmap.progress ]] && {
exit 0
@@ -21,9 +19,9 @@ if [ "$1" = "install" ]; then
opkg install nmap --dest sd
fi
# if [ ! -f /usr/lib/libpcap.so ] && [ -f /usr/lib/libpcap.so.1.3 ]; then
# ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.1.3
# fi
if [ ! -f /usr/lib/libpcap.so ] && [ -f /usr/lib/libpcap.so.1.3 ]; then
ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.1.3
fi
touch /etc/config/nmap
echo "config nmap 'module'" > /etc/config/nmap

View File

@@ -1,7 +1,8 @@
#!/bin/sh
#2015 - Whistle Master
logger "== STARTING NMAP SCRIPT"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
MYTIME=`date +%s`
MYCMD=`cat /tmp/nmap.run`