Community discussions

MikroTik App
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Help with this script

Sat Oct 05, 2024 4:10 pm

Mr. Rextended, I see that you are a person who knows a lot about scripts.
:local cmac $"mac-address"
:foreach RANDOOM in=[/ip hotspot active find user="$username" mac-address!=$cmac] do={
  /ip hotspot active remove $RANDOOM}
Can you tell me why the script doesn't work?
Thank you.
 
helipos
Member Candidate
Member Candidate
Posts: 142
Joined: Sat Jun 25, 2016 11:32 am

Re: Help with this script

Sat Oct 05, 2024 4:27 pm

You can usually help yourself by putting scripts like this inside some brackets and pasting it in to the terminal in winbox.
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: Help with this script

Sun Oct 06, 2024 1:17 pm

Can someone help me please.
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: Help with this script

Tue Oct 08, 2024 4:57 pm

Rextended friend, can you help me?


Thank you.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12861
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Help with this script

Sat Oct 12, 2024 3:14 am

at least, untested, something like this:
 /ip hotspot active remove [find where user=$username and mac-address!=$"mac-address"]

and you do not provide any relevant detail, like routeros version and where the script is put.
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: Help with this script

Sat Oct 12, 2024 12:39 pm

Thanks for responding friend Rextended.
This script goes in: IP HOTSPOT USER PROFILE SCRIPT and the firmware is 6.49.17

I want to use it to eliminate those clients who use random Macs on their computers, I hope you understand me.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12861
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Help with this script

Sat Oct 12, 2024 12:45 pm

You want remove all user with same name but different mac-address? See my previous script example.
Not using hotspots I do not guarantee that work as expected, but the script is correct.
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: Help with this script

Sat Oct 12, 2024 12:55 pm

I want to eliminate users who connect to the hotspot with a different mac address than the user who is already connected first, I hope you understand me
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12861
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Help with this script

Sat Oct 12, 2024 2:07 pm

I want to use it to eliminate those clients who use random Macs on their computers, I hope you understand me.
Do it on wifi, do not allow fake/service MAC.
But experienced user can still change to one apparenlty valid MAC...

I want to eliminate users who connect to the hotspot with a different mac address than the user who is already connected first, I hope you understand me
set only one "shared users" on user profile, and if you use user-manager bind MAC on first use.

What you want do can not be doed on scripts, must doed on settings and eventually AP connect list or on interface traffic filter.
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: Help with this script

Sun Oct 13, 2024 4:30 pm

:local cmac $"mac-address"
:foreach RANDOOM in=[/ip hotspot active find user="$username" mac-address!=$cmac] do={
  /ip hotspot active remove $RANDOOM}

Friend REXTENDED, but is the script the way I wrote it wrong?
 
FRANKMUNOZAPURE
just joined
Topic Author
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: Help with this script

Mon Oct 14, 2024 1:33 pm

Please clarify that for me friend REXTENDED.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12861
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Help with this script

Mon Oct 14, 2024 1:39 pm

I won't add anything else, just read post #9
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22903
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Help with this script

Mon Oct 14, 2024 2:42 pm

Dice che gli script non risolveranno le tue esigenze e che utilizzeranno le impostazioni del router disponibili inclusi ma non limitati a elenchi e filtri.