Jump to content

Advanced Module Systems


Recommended Posts

Hi !

For those who are interested, I made some small improvements to the actual Module Systems:

Features

- Modules size on the MK4,

- Modules size to download,

- Modules updates verifications

Install

Download

scp modules_advanced.php root@172.16.42.1:/www/pineapple/

Usage

http://172.16.42.1/pineapple/modules_advanced.php

e0d3fa7cfbfb4506218edb865f2a9c88f72d95a87fab1d95a61bed5d429623392g.jpg

Edited by Whistle Master
Link to comment
Share on other sites

Hi !

For those who are interested, I made some small improvements to the actual Module Systems:

Features

- Modules size on the MK4,

- Modules size to download,

- Modules updates verifications

Install

Download

scp modules_advanced.php root@172.16.42.1:/www/pineapple/

Usage

http://172.16.42.1/pineapple/modules_advanced.php

e0d3fa7cfbfb4506218edb865f2a9c88f72d95a87fab1d95a61bed5d429623392g.jpg

This is great WM:-D

I was hoping something like this was going to be included but didn't expect someone like you too.

EDIT:

If there is a new version does it give an option to upgrade? uninstall then install

Edited by petertfm
Link to comment
Share on other sites

This is great WM:-D

I was hoping something like this was going to be included but didn't expect someone like you too.

EDIT:

If there is a new version does it give an option to upgrade? uninstall then install

Yes It does :) But we don't see it on the screenshot, I agree. I made a new one which show the option:

7284ed315a0087dceb3cf13127fdd4e445641ca2148b898bd5f2e5d1ca5992862g.jpg

Link to comment
Share on other sites

  • 3 weeks later...

Something similar to this will be in a firmware release.

Best,

Sebkinne

The 2.0.0 version doesn't reflect the advanced_modules.php capabilities.

WM's version is way better IMO i don't mean any disrespect though :)

Link to comment
Share on other sites

Thanks WM!

Though I get this error:

Warning:  file_get_contents() [function.file-get-contents]: HTTP request failed! HTTP/1.1 404 NOT FOUND
 in /www/pineapple/modules_advanced.php on line 120



Warning:  file_get_contents(http://wifipineapple.com/downloads.php?moduleList) [function.file-get-contents]: failed to open stream: Address family not supported by protocol in /www/pineapple/modules_advanced.php on line 120

Think the download link is down/wrong>?

Link to comment
Share on other sites

The 2.0.0 version doesn't reflect the advanced_modules.php capabilities.

WM's version is way better IMO i don't mean any disrespect though :)

We didn't implement the new module system on the pineapple yet.

That will come relatively soon though. I simply am too busy at the moment and focused on a more stable backend.

Best,

Sebkinne

Link to comment
Share on other sites

Removed

just follow this one and now my index.php is redirecting me to an mediafire not found page :)

how can i solve this?

Thank you!

EDIT: That`s really strange..i cannot reach any of the normal html site..i though i just repeat the firmaware update and solve the problem there but nothin :(

I know nothing lol i have the PA since 2 days..und only managed the upodate to 2.0

but i am slowly evolving ^^

Edited by Sebkinne
Link to comment
Share on other sites

I wasn`t able to solve the problem until now..can anybody please help me?

I just can`t get back to the web interface..it asks my login normaly and then redirects me to the mediafire not found page within the pineapple..

Easiest way is to scp upgrade.bin (2.0.0) to /tmp/ folder SSH into pineapple and run sysupgrade -n -v /tmp/upgrade.bin it will re-flash your firmware so you have a default pineapple again.

Then scp modules_advanced.php to /www/pineapple/

Backup original modules.php like this: mv modules.php modules.php.backup

Rename modules_advanced.php to modules.php like this: mv modules_advanced.php modules.php

This way you don't have to fiddle with navbar.php, because you will simple replace the default modules.php with the advanced one ;)

Here's the code of the original /www/pineapple/index.php, maybe you messed something up in there:

<html>
<head>
<title>Pineapple Control Center</title>
<!--<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">-->
<script type="text/javascript" src="includes/ajax.js"> </script>
<script type="text/javascript" src="logtail/logtail.js"> </script>
</head>
<body bgcolor="black" text="white" alink="green" vlink="green" link="green" onload="getLog('start');">

<?php require('includes/navbar.php'); ?>
<pre>

<table border="0" width="100%"><tr><td valign="top" align="left" width="350">
<b>Services</b><br />
<?php

$iswlanup = exec("ifconfig wlan0 | grep UP | awk '{print $1}'");
if ($iswlanup == "UP") {
echo " Wireless  <font color=\"lime\"><b>enabled</b></font> | <a href=\"wlan.php?stop\"><b>Stop</b></a><br />";
} else { echo " Wireless  <font color=\"red\"><b>disabled</b></font> | <a href=\"wlan.php?start\"><b>Start</b></a><br />"; }

if ( exec("hostapd_cli -p /var/run/hostapd-phy0 karma_get_state | tail -1") == "ENABLED" ){
$iskarmaup = true;
}
if ($iskarmaup != "") {
echo "MK4 Karma  <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"karma/stopkarma.php\"><b>Stop</b></a><br />";
} else { echo "MK4 Karma  <font color=\"red\"><b>disabled</b></font>. | <a href=\"karma/startkarma.php\"><b>Start</b></a> <br />"; }

$autoKarma = ( exec("if grep -q 'hostapd_cli -p /var/run/hostapd-phy0 karma_enable' /etc/rc.local; then echo 'true'; fi") );
if ($autoKarma != ""){
echo "Autostart  <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"karma/autoKarmaStop.php\"><b>Stop</b></a><br />";
} else { echo "Autostart  <font color=\"red\"><b>disabled</b></font>. | <a href=\"karma/autoKarmaStart.php\"><b>Start</b></a><br />"; }

$cronjobs = ( exec("ps -all | grep [c]ron"));
if ($cronjobs != ""){
echo "Cron Jobs <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"jobs.php?stop&goback\"><b>Stop</b></a><br />";
} else { echo "Cron Jobs <font color=\"red\"><b>disabled</b></font>. | <a href=\"jobs.php?start&goback\"><b>Start</b></a> | <a href=\"jobs.php\"><b>Edit</b></a><br />"; }

$isurlsnarfup = exec("ps auxww | grep urlsnarf.sh | grep -v -e grep");
if ($isurlsnarfup != "") {
echo "URL Snarf  <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"urlsnarf/stopurlsnarf.php\"><b>Stop</b></a><br />";
} else { echo "URL Snarf  <font color=\"red\"><b>disabled</b></font>. | <a href=\"urlsnarf/starturlsnarf.php\"><b>Start</b></a><br />"; }

$isdnsspoofup = exec("ps auxww | grep dnsspoof.sh | grep -v -e grep");
if ($isdnsspoofup != "") {
echo "DNS Spoof  <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"dnsspoof/stopdnsspoof.php\"><b>Stop</b></a><br />";
} else { echo "DNS Spoof  <font color=\"red\"><b>disabled</b></font>. | <a href=\"dnsspoof/startdnsspoof.php\"><b>Start</b></a> | <a href=\"config.php#spoofhost\"><b>Edit</b></a><br/>"; }

/*$isngrepup = exec("ps auxww | grep ngrep | grep -v -e \"grep ngrep\" | awk '{print $1}'");
if ($isngrepup != "") {
echo "    ngrep  <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"ngrep/stopngrep.php\"><b>Stop</b></a>";
} else { echo "    ngrep  <font color=\"red\"><b>disabled</b></font>. | <a href=\"ngrep/startngrep.php\"><b>Start</b></a> | <a href=\"config.php#ngrep\"><b>Edit</b></a><br/>"; }
*/

if (exec("grep 3g.sh /etc/rc.local") != ""){                                                         
echo "3G bootup  <font color=\"lime\"><b>enabled</b></font>.  | <a href=\"3g.php?disable&disablekeepalive&goback\"><b>Disable</b></a><br />";
} else { echo "3G bootup <font color=\"red\"><b>disabled</b></font>. | <a href=\"3g.php?enable&goback\"><b>Enable</b></a><br />"; }              

if (exec("grep 3g-keepalive.sh /etc/crontabs/root") == "") {                                                                              
echo "3G redial <font color='red'><b>disabled</b></font>. | <a href='3g.php?enablekeepalive&enable&goback'><b>Enable</b></a><br />";             
} else { echo "3G redial <font color='lime'><b>enabled</b></font>.  | <a href='3g.php?disablekeepalive&goback'><b>Disable</b></a><br />"; } 

if (exec("ps aux | grep [s]sh | grep -v -e ssh.php | grep -v grep") == "") {                                                                                             
echo "      SSH <font color=\"red\"><b>offline</b></font>.  | <a href=\"ssh.php?connect\"><b>Connect</b></a><br /><br />";        
} else {         
echo "      SSH <font color=\"lime\"><b>online</b></font>.   | <a href=\"ssh.php?disconnect\"><b>Disconnect</b></a><br /><br />";
} 


echo "<br/><b>Interfaces</b><br />";

echo " PoE / LAN Port: " . exec("ifconfig br-lan | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'") . "<br />";
echo "   USB 3G Modem: " . exec("ifconfig 3g-wan2 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'") . "<br />";
echo " WAN / LAN Port: " . exec("ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'") . "<br />";
echo "Public Internet: "; 
if (isset($_GET[revealpublic])) { 
	echo exec("wget -qO- http://cloud.wifipineapple.com/ip.php") . "<br />"; 
} else { 
	echo "<a href=\"index.php?revealpublic\">reveal public ip</a><br />"; 
}

?>

</td><td valign="top" align="left" width="*">



<pre>
<a href="#" onclick="getLog('start');return false"><b>Resume Log</b></a> | <a href="#" onclick="stopTail();return false"><b>Pause Log</b></a> | <?php if (isset($_GET[report])) { echo "<a href='index.php'><b>Dismiss Detailed Report</b></a>"; } else { echo "<a href='index.php?report'><b>Generate Detailed Report</b></a>"; } ?><br />

<?php
if (isset($_GET[report])) {
	echo "<br /><b>Detailed Report</b>     <small><font color='gray'>CPU Intensive. Do not re-run reports in rapid succession</font></small><br /><br />";
	$cmd="/www/pineapple/karma/karmaclients.sh";
	exec("$cmd 2>&1", $output);                                                                                                                                     
	foreach($output as $outputline) {
		 echo ("$outputline\n");         
	 }
} else {

	echo "<div id='log'>Karma Log:</div>";

}

?>


</pre>
</td></tr></table>
</pre><!-- http://www.youtube.com/watch?v=KqL_nsSl_Fs //easter egg -->
</body>
</html>

Edited by WatskeBart
Link to comment
Share on other sites

@ watskebart

thank you very much sir. Worked like a charm..

but advanced_modules.php ist still a mediafire page..can it be that the file is somehow corrupt?

can somebody please post the code of the original advanced_module.php file?

Thank you very much !

Link to comment
Share on other sites

I verified and the mediafire download is working fine. You have to download and copy the file to your pineapple to make it work.

Sorry for the false alarm !

I wget the modules_advanced.php from my web server and somehow it got corrupted in transit.. I added a .bin and then it transfered without problem..

I wanted to use winSCP but it tells me there is no sftpserver running..where can I enable it to make sure this error doesnt occur a second time.

Anyway thanks for helping the noob :)

Link to comment
Share on other sites

Guys,

I am getting an error with the get_file_content function in PHP.

In both Modules.php and in this new advanced_module.php.

ERROR=

Warning: file_get_contents(modules/moduleList) [function.file-get-contents]: failed to open stream: No such file or directory in /www/pineapple/modules_advanced.php on line 96

I am getting failed to open stream. If I do a wget to same url from the PA I have no problem pulling down the text file.

Does anyone know why get_file_contents would have an issue with this or is there another possible reason this may fail?

Thanks all for any insight.

CubeDweller

Link to comment
Share on other sites

Setup WinSCP to use SCP protocol instead of SFTP ;)

:blink: I owe u a drink !

@ cubert..

i cannot see that this is related..as i am a linux dumbfuck but swore I am gonna learn it and the pineapple seems like a good motivator..i like hard puzzles ^^

Everything worked fine but now i cannot check for updates or get the modules list..and as i can ssh see the web and routing tables are correct..I assume pretty much your error IS related and the modules/pineapple repos are down?

yeah the OPKG Manager also works smooth..

Edited by Yamada Taro
Link to comment
Share on other sites

With me I can wget the mod list. The php function get_file_contents is failing. The error is base on the stream it received or did not receive. I am going to copy off the modules_advance.php to my web server and see if I can recreate the same issue on my lamp in efforts to debug my error.

Cubert

Edited by Cubert
Link to comment
Share on other sites

Removed

Files are duds, they overwrite the navbar.php file with a link to mediafire and some redirect code.

Funny little script kiddie we have.

First post is to give shortcuts for other users. Not good at all.

Only trust tips on downloading modules to the author themselves, such as WM and BrianZimm.

Somebody please delete this twats links above before he does moe damage

Edited by Sebkinne
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...