2016-09-10 - Re: [GRASE-Hotspot] Re: Power Off and User Re-Login
Header Data
From: Timothy White <ti***8@gmail.com>
Message Hash: b40119bc150f92ae7f4176862851a3d696c13d5e2ddb7d127e4aca8b7f0768af
Message ID: <CAESLx0+Cfprf_qnrKK0nj86-xNeY1S=DGFFLLnOxDUVMivRW_g@mail.gmail.com>
Reply To: <8a5dc0cf-a32a-4c4f-8df8-9ceadbc21922@grasehotspot.org>
UTC Datetime: 2016-09-10 03:33:15 UTC
Raw Date: Sat, 10 Sep 2016 20:33:15 +1000
Raw message
Just an observation:
... WHERE UserName != 'CoovaChilli' and AcctStopTime is null ...
After a reboot, you shouldn't have any session with AcctStopTime as null
unless they are new sessions. The reason is that when Freeradius is cleanly
shutdown, it ends all sessions. You should see the session stop reason as
one of the reasons listed at
http://www.juniper.net/techpubs/en_US/junos16.1/topics/concept/radius-terminate-code-app-terminate-reasons-mapping.html.
I believe it'll be "Admin Reboot" or "NAS Reboot". So you'd want to look
for sessions that have recently ended with a stop reason like that.
Not sure why this script was working for other people, but in my experience
the only reason you'd have a Null AcctStopTime after a reboot would be an
unclean shutdown.
Regards
Tim
On Fri, Sep 9, 2016 at 11:11 PM, 'Eliot Ness' via Grase Hotspot <
gr***t@grasehotspot.org> wrote:
> Let's have a detailed review :
>
> <?php
>
> # GET ALL DEVICES CONNECTED TO HOTSPOT WITHOUT LOGIN
> $result = str_replace("\n", "|", trim(shell_exec("sudo chilli_query list
> | grep 'dnat' | awk '{print $1}'")));
> $macs_connected = explode("|",$result);
> echo "<h1>Connected devices without login</h1>";
> echo "<pre>";
> print_r($macs_connected);
> echo "</pre>";
>
> # GET ALL UNCLOSED SESSIONS FROM DATABASE THAT MATCH THE CURRENTLY
> CONNECTED DEVICES WITHOUT LOGIN
> $link = mysqli_connect("127.0.0.1", "root", "password", "radius");
> $query = "SELECT CallingStationId, UserName, FramedIpAddress,
> AcctStopTime FROM radius.radacct WHERE UserName != 'CoovaChilli' and
> AcctStopTime is null and CallingStationId in ('".implode("','",$macs_connected)."')
> Group BY CallingStationId ORDER by RadAcctId DESC";
> if ($result = $link->query($query))
> {
> $loggedin = array();
> while ($device= $result->fetch_assoc()) {
> shell_exec("sudo chilli_query authorize mac
> ".$device['CallingStationId']." username ".$device['UserName']);
> $loggedin[]=$row['CallingStationId'];
> }
> $result->free();
> echo "<h1>Devices we auto-logged in</h1>";
> var_dump($loggedin);
> }
> mysqli_close($link);
> ?>
>
> The above script seems that running ok.
> I cant run with wget, but i test it on var/www/html and call it via web
> browser.
>
> So if i call it on http://grase-ip/reconnect.php results are ( where xx
> is the device mac address )
>
> Connected devices without login
>
> Array
> (
> [0] => xx-xx-xx-xx-xx-xx
> )
>
> Devices we auto-logged in
> array(0) { }
>
> So on reboot it does not reconnect any device and result is
> Devices we auto-logged in
> array(0) { }
>
> This script need an extra param to re-auth users....but i dont know what.
> Any php expert can help?
>
> On Thursday, June 2, 2016 at 9:40:51 AM UTC+3, Eliot Ness wrote:
>>
>> At least one Pi2 comes yesterday in my hands, and ....grase run again.
>> Detailed tutorial steps install on next days.
>>
>> As simple question : On power off or reboot, user have login again,
>> except if admin store mac adr.
>>
>> Is there any way on grase to remember users after reboot ? So no need
>> user to login again....
>>
>> Anyone?
>>
> --
> This mailing list is for the Grase Hotspot Project http://grasehotspot.org
> ---
> You received this message because you are subscribed to the Google Groups
> "Grase Hotspot" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gr***e@grasehotspot.org.
> To post to this group, send email to gr***t@grasehotspot.org.
> Visit this group at https://groups.google.com/a/gr
> asehotspot.org/group/grase-hotspot/.
> To view this discussion on the web visit https://groups.google.com/a/gr
> asehotspot.org/d/msgid/grase-hotspot/8a5dc0cf-a32a-4c4f-
> 8df8-9ceadbc21922%40grasehotspot.org
> <https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/8a5dc0cf-a32a-4c4f-8df8-9ceadbc21922%40grasehotspot.org?utm_medium=email&utm_source=footer>
> .
>
Thread
- Return to June 2016
- Return to July 2016
- Return to August 2016
-
Return to September 2016
- Return to “Hotspotuser <jo***s@algardata.pt>”
- Return to “Eliot Ness <sc***7@googlemail.com>”
- Return to “Timothy White <ti***8@gmail.com>”
-
Return to “Edward Allen <yb***j@gmail.com>”
- 2016-06-01 (Wed, 01 Jun 2016 23:40:51 -0700) - Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-06-02 (Thu, 02 Jun 2016 19:20:48 +1000) - Re: [GRASE-Hotspot] Power Off and User Re-Login - Timothy White <ti***8@gmail.com>
- 2016-07-08 (Fri, 08 Jul 2016 08:08:15 -0700) - Re: [GRASE-Hotspot] Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-08-05 (Fri, 05 Aug 2016 16:08:15 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-08-08 (Mon, 08 Aug 2016 01:47:54 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-08-10 (Wed, 10 Aug 2016 11:16:43 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-08-11 (Thu, 11 Aug 2016 02:00:13 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-08-11 (Thu, 11 Aug 2016 16:56:42 +0000) - Re: [GRASE-Hotspot] Re: Power Off and User Re-Login - Edward Allen <yb***j@gmail.com>
- 2016-08-11 (Thu, 11 Aug 2016 02:00:13 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-08-16 (Tue, 16 Aug 2016 23:34:06 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-08-17 (Wed, 17 Aug 2016 03:01:35 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-08-25 (Thu, 25 Aug 2016 14:10:25 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-08-26 (Fri, 26 Aug 2016 02:28:20 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-08-28 (Sun, 28 Aug 2016 12:16:44 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-09 (Fri, 09 Sep 2016 06:11:38 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-10 (Sat, 10 Sep 2016 20:33:15 +1000) - Re: [GRASE-Hotspot] Re: Power Off and User Re-Login - Timothy White <ti***8@gmail.com>
- 2016-09-13 (Tue, 13 Sep 2016 01:42:44 -0700) - Re: [GRASE-Hotspot] Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-10 (Sat, 10 Sep 2016 20:33:15 +1000) - Re: [GRASE-Hotspot] Re: Power Off and User Re-Login - Timothy White <ti***8@gmail.com>
- 2016-09-13 (Tue, 13 Sep 2016 06:39:36 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-13 (Tue, 13 Sep 2016 06:45:00 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-13 (Tue, 13 Sep 2016 07:38:47 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-13 (Tue, 13 Sep 2016 07:44:28 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-13 (Tue, 13 Sep 2016 07:46:51 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-13 (Tue, 13 Sep 2016 07:44:28 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-15 (Thu, 15 Sep 2016 05:18:15 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-15 (Thu, 15 Sep 2016 06:39:04 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-15 (Thu, 15 Sep 2016 06:44:18 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-15 (Thu, 15 Sep 2016 06:45:58 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-15 (Thu, 15 Sep 2016 06:44:18 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-15 (Thu, 15 Sep 2016 06:47:00 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-15 (Thu, 15 Sep 2016 06:39:04 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-17 (Sat, 17 Sep 2016 07:30:01 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-20 (Tue, 20 Sep 2016 05:57:02 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-09-27 (Tue, 27 Sep 2016 09:55:32 -0700) - Re: Power Off and User Re-Login - Eliot Ness <sc***7@googlemail.com>
- 2016-09-20 (Tue, 20 Sep 2016 05:57:02 -0700) - Re: Power Off and User Re-Login - Hotspotuser <jo***s@algardata.pt>
- 2016-06-02 (Thu, 02 Jun 2016 19:20:48 +1000) - Re: [GRASE-Hotspot] Power Off and User Re-Login - Timothy White <ti***8@gmail.com>