]> git.ipfire.org Git - people/dweismueller/ipfire-2.x.git/commitdiff
Captive-Portal: fix cleanup script
authorAlexander Marx <alexander.marx@ipfire.org>
Mon, 8 Feb 2016 09:56:01 +0000 (10:56 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 14 Dec 2016 13:02:25 +0000 (14:02 +0100)
The cleanup-script did not write back the hash after the expired voucher
was delted

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
src/scripts/captive-cleanup

index aae6f6064df42cb281463c94f4e003873783f6ee..c39e4883a1e985cebf2d71f8f138e5a6057d0194 100755 (executable)
@@ -37,7 +37,10 @@ if (-f $settingsfile && -f $clients && ! -z $clients){
        foreach my $key (keys %clientshash) {
                $expiretime=($clientshash{$key}[2])+$clientshash{$key}[3];
                if ($expiretime < $time){
-                       delete $clientshash{key};
+                       delete $clientshash{$key};
+                       my $exp = gmtime($expiretime);
+                       &General::log("Captive", "Delete expired voucher $clientshash{$key}[4] expired on $exp. Remark: $clientshash{$key}[5]");
                }
        }
+       &General::writehasharray("$clients", \%clientshash);
 }