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.
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?
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”