www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

Captive Portal Freeclients

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell
View previous topic :: View next topic  
Author Message
netindividuo



Joined: 10 May 2013
Posts: 2

PostPosted: Fri May 10, 2013 1:24 pm    Post subject: Captive Portal Freeclients Reply with quote

There seems to be a bug that makes an overwrite of the last entered free client on the captive portal webpage once 100 clients are reached, even if you erase old ones.

By digging around I've found that the numbers on the DB do not get reused.

Quote:

root@zeroshell /> ls ./Database/var/register/system/cp/FreeClients/
00 18 21 23 27 29 31 33 36 39 45 47 49 54 62 64 68 70 75 77 79 83 90 93 96 99
100 20 22 25 28 30 32 35 37 43 46 48 53 55 63 66 69 74 76 78 81 85 92 95 98




Is it safe to modify it by hand, by doing a few moves in the Freeclients folders?



Or do I need to modify the script that is used to addClients to the cautive portal?

Quote:

root@zeroshell /> cat ./root/kerbynet.cgi/scripts/cpAddClient
#!/bin/sh
. /etc/kerbynet.conf
DESC="$1"
IP="$2"
[ "$IP" == Any ] && IP=""
MAC="$3"
[ "$MAC" == Any ] && MAC=""
CONFIG=$REGISTER/system/cp
cd $CONFIG/FreeClients
LAST=`ls -d * 2>/dev/null |tail -1`
if [ -z "$LAST" ] ; then
NEW=00
else
if [ "${LAST:0:1}" == 0 ] ; then
LAST="${LAST:1:1}"
fi
NEW="$((LAST+1))"
if [ "$NEW" -lt 10 ] ; then
NEW=0$NEW
fi
fi
mkdir $NEW
echo "$DESC" > $CONFIG/FreeClients/$NEW/Desc
echo "$IP" > $CONFIG/FreeClients/$NEW/IP
echo "$MAC" > $CONFIG/FreeClients/$NEW/MAC
$SCRIPTS/cpAddClientIPT "$IP" "$MAC"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group