Community discussions

MikroTik App
 
brasileottanta
Member Candidate
Member Candidate
Topic Author
Posts: 122
Joined: Thu Jun 22, 2006 8:52 am

Script for remove ip-binding in hotspot

Sat May 25, 2013 7:16 pm

I need a script for ROS , to delete all ip-binding inside hotspot.

I try some script but with no lucky.

Any working solution ?

Regard

brasileottanta
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: Script for remove ip-binding in hotspot

Sat May 25, 2013 11:23 pm

with this script you can remove all ip-binding entries.

ros code

ip hotspot ip-binding remove [find]
 
brasileottanta
Member Candidate
Member Candidate
Topic Author
Posts: 122
Joined: Thu Jun 22, 2006 8:52 am

Re: Script for remove ip-binding in hotspot

Sun May 26, 2013 8:42 pm

with this script you can remove all ip-binding entries.

ros code

ip hotspot ip-binding remove [find]
Thanks.:-) Do you know a script that remove all ip-binding of specific server ?

like this : ip hotspot ip-binding remove [find] server=myhotspot


bye.

brasileottanta
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Script for remove ip-binding in hotspot

Sun May 26, 2013 9:03 pm

The "find" command can accept a condition, so:

ros code

ip hotspot ip-binding remove [find where server=myhotspot]
 
Sirgiancelot
just joined
Posts: 1
Joined: Thu Jul 10, 2014 8:23 pm

Re: Script for remove ip-binding in hotspot

Tue Aug 16, 2016 6:31 pm

hello, excuse my English is bad,
I need a script to do this:
bypassed and blocked a ip ip or mac bindings with schedule
eh tried in various ways but nothing, example:
/ip hotspot ip-binding blocked [find rule=19.168.48.65]
 
User avatar
BrasDeutscher
newbie
Posts: 41
Joined: Sat Sep 03, 2016 12:31 am
Location: Brazil

Re: Script for remove ip-binding in hotspot

Sun Sep 04, 2016 3:43 am

## Ver este ai, do BrasDeutscher, Pará ##
## Script to Remove all Regular IP-Bindings ##
## RouterOS 6.37rc27 from BrasDeutscher ##
{
# set your server name here #
:global sv "Hotspot"

# set here 0 for regular, or 7 for blocked, or 8 for bypassed #
:global num 0

## !!-- Do not edit the below, this can breake my script --!! ##
:global tp
:global tpn
:global mac
:global action
:foreach i in=[/ip hotspot ip-binding find where server="$sv" ] do={
:set tp [/ip hotspot ip-binding get $i type ];
:set tpn [:len $tp ];
:if ("$tpn" = "$num" ) do={
:set mac [/ip hotspot ip-binding get $i mac-address ];
:set action [/ip hotspot ip-binding remove [find where mac-address=$mac ]];
:log warning ("Removing Code:$num Mac => $mac");
}}}

Who is online

Users browsing this forum: No registered users and 5 guests