How to disconnect all users

Home Page Forums Network Management ZeroShell How to disconnect all users

This topic contains 0 replies, has 0 voices, and was last updated by  japabsb 5 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43981

    japabsb
    Member

    How to disconnect all users from Captive Portal? And how to delete all entries on accounts?

    #53362

    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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.