Noth Posted December 4, 2016 Share Posted December 4, 2016 Hi ! I've just finished developing my first module for "/etc/pineapple/ssid_file" management. This module allows you to: - Backup the SSID pool file - View/Delete backups - Restore backups - Merge all SSID to a single file and restore it Everything is available on: https://github.com/NothNoth/SSIDPool/tree/master Enjoy ! Noth Quote Link to comment Share on other sites More sharing options...
eLement6 Posted January 20, 2017 Share Posted January 20, 2017 Good Job! im excited to give it a try Quote Link to comment Share on other sites More sharing options...
b0N3z Posted January 26, 2017 Share Posted January 26, 2017 are you going to push this to the pineapple module manager? Quote Link to comment Share on other sites More sharing options...
Noth Posted January 30, 2017 Author Share Posted January 30, 2017 On 26/01/2017 at 1:14 AM, b0N3z said: are you going to push this to the pineapple module manager? I'd be happy to do it yes, but I'd don't see how to ? Quote Link to comment Share on other sites More sharing options...
b0N3z Posted January 30, 2017 Share Posted January 30, 2017 (edited) whenever I try to download it from github, my computer tells me there is a virus detected and fails to download. Edited January 30, 2017 by b0N3z Quote Link to comment Share on other sites More sharing options...
Noth Posted January 30, 2017 Author Share Posted January 30, 2017 3 hours ago, b0N3z said: whenever I try to download it from github, my computer tells me there is a virus detected and fails to download. Well for now you'll have to scp the module to your Pineapple. I meant that I have no idea how modules are selected to appear in the "official" list of modules on the modules manager ;) About the Virus: well, I don't know how your antivirus finds something in my 50 lines of js + php.. ;) Quote Link to comment Share on other sites More sharing options...
b0N3z Posted January 30, 2017 Share Posted January 30, 2017 I have windows defender, thats it. When I download the zip file from your github page it says what i posted above. Im using chrome browser. Quote Link to comment Share on other sites More sharing options...
MarcSThe1st Posted February 2, 2017 Share Posted February 2, 2017 (edited) send it to @Sebkinne, or ask him. He'll know Edited February 2, 2017 by MarcSThe1st Quote Link to comment Share on other sites More sharing options...
sud0nick Posted February 2, 2017 Share Posted February 2, 2017 If you want to submit your module to the Module Manager you have to create an account at https://wifipineapple.com/portal. Create a .tar.gz of your module and upload it there. 1 Quote Link to comment Share on other sites More sharing options...
b0N3z Posted February 5, 2017 Share Posted February 5, 2017 (edited) So I finally got around to putting on my nano and seems really cool. Hopefully this week I will have time to mess with it a little. Still dont know why chome wouldnt download the zip from the github, but a simple git clone fixed that. Update: The Current SSID pool count is always 1 off. Starting at -1 when there are no ssid in the PineAP pool. I found a fix under module.php private function getSSIDCount() { $ssidfile = "/etc/pineapple/ssid_file"; $this->response = array("error" => "", "ssidCount" => count(file($ssidfile)) - 1 ); <----- change the 1 to a 0 so it looks like )) - 0 ); } private function getSSIDPool() { I have modified this on mine and seems to have fixed the count on the SSID pool in the module. Edited February 5, 2017 by b0N3z Quote Link to comment Share on other sites More sharing options...
sud0nick Posted February 5, 2017 Share Posted February 5, 2017 3 hours ago, b0N3z said: "ssidCount" => count(file($ssidfile)) - 1 ); <----- change the 1 to a 0 so it looks like )) - 0 ); You could also just not subtract anything and return the number of elements . 1 Quote Link to comment Share on other sites More sharing options...
b0N3z Posted February 5, 2017 Share Posted February 5, 2017 Just now, sud0nick said: You could also just not subtract anything and return the number of elements . for not knowing to much about coding still, i was pretty happy it worked lol. when you say element, in this case, that would be the number off ssid it should be showing? Quote Link to comment Share on other sites More sharing options...
sud0nick Posted February 5, 2017 Share Posted February 5, 2017 Sort of, the file() function in PHP returns an array of lines from the file. $lines = file($ssidFile); This allows us to access each line of the file individually by using its index which would be n-1 where n is the line number you want. // Echo line 1 echo $lines[0]; // Echo line 2 echo $lines[1]; So to get the number of lines in the file we can use the count() function to count the number of elements in the array. echo count($lines); In this particular case the SSID file contains one SSID per line. So the number of lines in the file is equal to the number of SSIDs. I think Noth may have confused the principle of zero indexing an array with getting its number of elements which is why they subtracted one from the count. 1 Quote Link to comment Share on other sites More sharing options...
b0N3z Posted February 10, 2017 Share Posted February 10, 2017 Just put this on my Tetra and when I backup SSID pool it says failure everytime. Quote Link to comment Share on other sites More sharing options...
Noth Posted February 11, 2017 Author Share Posted February 11, 2017 On 05/02/2017 at 11:41 PM, sud0nick said: Sort of, the file() function in PHP returns an array of lines from the file. $lines = file($ssidFile); This allows us to access each line of the file individually by using its index which would be n-1 where n is the line number you want. // Echo line 1 echo $lines[0]; // Echo line 2 echo $lines[1]; So to get the number of lines in the file we can use the count() function to count the number of elements in the array. echo count($lines); In this particular case the SSID file contains one SSID per line. So the number of lines in the file is equal to the number of SSIDs. I think Noth may have confused the principle of zero indexing an array with getting its number of elements which is why they subtracted one from the count. Hi, Actually, in my case, there was a trailing \n\r at then end of SSID file, which was adding an additional fake empty line. I'll check again and will remove the "-1" if useless ! Quote Link to comment Share on other sites More sharing options...
Noth Posted February 11, 2017 Author Share Posted February 11, 2017 13 hours ago, b0N3z said: Just put this on my Tetra and when I backup SSID pool it says failure everytime. Do you have some kind of error message or something ? Did you install the module on an external SDCard ? (I didn't actually tested on internal storage) Quote Link to comment Share on other sites More sharing options...
Noth Posted February 11, 2017 Author Share Posted February 11, 2017 10 minutes ago, Noth said: Hi, Actually, in my case, there was a trailing \n\r at then end of SSID file, which was adding an additional fake empty line. I'll check again and will remove the "-1" if useless ! Allright, I pushed the patch, everything seems fine. Thanks for reporting the bug ! Quote Link to comment Share on other sites More sharing options...
b0N3z Posted February 11, 2017 Share Posted February 11, 2017 I just said failure next to the merge ssid button. Yes it is on the internal storage. Works great on the nano which is installed on the sd card. 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.