bobtheman Posted March 11, 2012 Share Posted March 11, 2012 since you can stop all other services I think it would be nice to disable wireless also. This way you can plug in and setup the device before sending out its ssid Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted March 11, 2012 Share Posted March 11, 2012 You can also issue the command through the Advanced menu: ifconfig wlan0 down Quote Link to comment Share on other sites More sharing options...
bobtheman Posted March 12, 2012 Author Share Posted March 12, 2012 sure no problem. yes ifconfig wlan up/down will work im just indicating a button on the status page where you can stop and start all other services would be ideal. Quote Link to comment Share on other sites More sharing options...
Valsacar Posted March 13, 2012 Share Posted March 13, 2012 You could always add one by editing the index.php page appropriately. Of course, that will only last until you upgrade firmware. Quote Link to comment Share on other sites More sharing options...
bobtheman Posted March 13, 2012 Author Share Posted March 13, 2012 interesting. is the mk4 source code online somewhere like on github where I could commit it Quote Link to comment Share on other sites More sharing options...
WatskeBart Posted April 25, 2012 Share Posted April 25, 2012 (edited) EDIT: I've change the commands given by start/stopwlan.php, instead of ifconfig i used wifi so the monitor interface will be started/shutdown as well. Complete WiFi silence when turned off ;) I updated the index.php myself :) Here's what you do ;) Use your favorite texteditor to edit this file: /www/pineapple/index.php Look for this piece of code: $iswlanup = exec("ifconfig wlan0 | grep UP | awk '{print $1}'"); if ($iswlanup == "UP") { echo " Wireless <font color=\"lime\"><b>enabled</b></font>.<br />"; } else { echo " Wireless <font color=\"red\"><b>disabled</b></font>.<br />"; } comment the code so it doesn't work anymore, because we are going to make some "new" code change it so it looks like this: (note the /* above and the */ under the code) /* $iswlanup = exec("ifconfig wlan0 | grep UP | awk '{print $1}'"); if ($iswlanup == "UP") { echo " Wireless <font color=\"lime\"><b>enabled</b></font>.<br />"; } else { echo " Wireless <font color=\"red\"><b>disabled</b></font>.<br />"; } */ Add the following code under the code you just commented: if ( exec("ifconfig wlan0 | grep UP | awk '{print $1}'") == "UP" ){ $iswlanup = true; } if ($iswlanup != "") { echo " Wireless <font color=\"lime\"><b>enabled</b></font>. | <a href=\"config/stopwlan.php\"><b>Stop</b></a><br />"; } else { echo " Wireless <font color=\"red\"><b>disabled</b></font>. | <a href=\"config/startwlan.php\"><b>Start</b></a> <br />"; } Save your index.php Now we are almost there but we need to make two more files. Create a file called startwlan.php and add follwing code: <?php exec ("wifi"); ?> <html><head> <meta http-equiv="refresh" content="0; url=/pineapple/"> </head><body bgcolor="black" text="white"><pre> <?php echo "Wireless started"; ?> </pre></head></body> And create a file called stopwlan.php and add following code: <?php exec("wifi down"); ?> <html><head> <meta http-equiv="refresh" content="0; url=/pineapple/"> </head><body bgcolor="black" text="white"><pre> <?php echo "Wireless disabled"; ?> </pre></head></body> Copy the files startwlan.php and stopwlan.php to /www/pineapple/config/ Refresh your Status page and voila! :D There are probably much easier and cleaner ways to do this, but it works and i wanted to contribute ;) Some screenies :D Edited April 27, 2012 by WatskeBart Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.