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 

How to disconnect all users

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



Joined: 03 Jul 2014
Posts: 1

PostPosted: Thu Jul 03, 2014 2:09 pm    Post subject: How to disconnect all users Reply with quote

How to disconnect all users from Captive Portal? And how to delete all entries on accounts?
Back to top
View user's profile Send private message
von_Schlieffen



Joined: 28 May 2013
Posts: 50

PostPosted: Tue Aug 05, 2014 8:30 pm    Post subject: Just create a litle script Reply with quote

To disconnect all connected users.

On /Database, create a directory named "scripts".
Inside this create a file named "removeALL" :
$ touch removeALL
$ chmod +x removeALL
$vi removeALL
push insert key

Copy and paste this script inside this file (lines behind Begin / End)

----- Begin
#!/bin/sh
. /etc/kerbynet.conf
CONFIG=$REGISTER/system/cp
DISCONNECT=$SCRIPTS/cp_disconnect
if ! [ -d $CONFIG/Connected ] ; then
mkdir -p $CONFIG/Connected
fi
cd $CONFIG/Connected
CLIENTS=`ls -d *`
for IP in $CLIENTS ; do
MAC=`cat $IP/MAC 2>/dev/null`
USER=`cat $IP/User 2>/dev/null`
echo "Disconnect $USER $IP $MAC"
. $DISCONNECT $IP
done
----- End

After push on esc
enter ":wq"

Thats all.
Try it.

You can create a cronjob to put this script running at specific time :

/Database/scripts/removeALL

Kind regards.
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