Community discussions

MikroTik App
 
justaguywithanmt
just joined
Topic Author
Posts: 9
Joined: Sun Mar 06, 2022 5:20 pm

Custom hotspot logout script issues ROS 7.7

Mon Feb 06, 2023 9:16 pm

Please help why logout script wont work, login script works fine.

LOGIN SCRIPT (working on simple queue)
:local pm1 "ml_pkt,online_games_pkt"
:local pm2 "speedtest_pkt"
:local pm3 "browsing_pkt,downloads_pkt,streaming_pkt"
:local qname ("<1-hotspot-".$user.">")
:local chld1 ($"qname"."-online-games")
:local chld2 ($"qname"."-speedtest")
:local chld3 ($"qname"."-surfing")

/queue simple 
add name=$qname target=$address max-limit="50M/50M" queue="hotspot-default/hotspot-default" place-before=0
add name=$chld1 target="" packet-marks=$pm1 max-limit="1M/1M" parent=$qname priority="1/1" queue="hotspot-default/hotspot-default"
add name=$chld2 target="" packet-marks=$pm2 max-limit="50M/50M" parent=$qname priority="8/8" queue="hotspot-default/hotspot-default"
add name=$chld3 target="" packet-marks=$pm3 max-limit="10M/10M" parent=$qname priority="8/8" queue="hotspot-default/hotspot-default"
LOGOUT SCRIPT (doesnt work on logout, simple queue entry for hotspot user remains on the queue)

/queue simple remove $chld3
/queue simple remove $chld2
/queue simple remove $chld1
/queue simple remove $qname

 
justaguywithanmt
just joined
Topic Author
Posts: 9
Joined: Sun Mar 06, 2022 5:20 pm

Re: Custom hotspot logout script issues ROS 7.7

Mon Feb 06, 2023 9:37 pm

Please enlighten me
 
justaguywithanmt
just joined
Topic Author
Posts: 9
Joined: Sun Mar 06, 2022 5:20 pm

Re: Custom hotspot logout script issues ROS 7.7

Mon Feb 06, 2023 11:17 pm

Please help: (
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Custom hotspot logout script issues ROS 7.7

Tue Feb 07, 2023 1:06 am

Where is defined $chld3, etc. on logout?
 
justaguywithanmt
just joined
Topic Author
Posts: 9
Joined: Sun Mar 06, 2022 5:20 pm

Re: Custom hotspot logout script issues ROS 7.7

Tue Feb 07, 2023 5:11 am

Where is defined $chld3, etc. on logout?
:local chld1 ($"qname"."-online-games")
:local chld2 ($"qname"."-speedtest")
:local chld3 ($"qname"."-surfing")

/queue simple remove $chld3
/queue simple remove $chld2
/queue simple remove $chld1
/queue simple remove $qname
 
justaguywithanmt
just joined
Topic Author
Posts: 9
Joined: Sun Mar 06, 2022 5:20 pm

Re: Custom hotspot logout script issues ROS 7.7

Tue Feb 07, 2023 1:54 pm

Where is defined $chld3, etc. on logout?
Please help me with this your humble sir
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Custom hotspot logout script issues ROS 7.7

Tue Feb 07, 2023 2:51 pm

Start by answering my question…

Is this the full script?
$chld3 & co. are undefined, must be declared like on login
 
justaguywithanmt
just joined
Topic Author
Posts: 9
Joined: Sun Mar 06, 2022 5:20 pm

Re: Custom hotspot logout script issues ROS 7.7

Tue Feb 07, 2023 7:17 pm

Start by answering my question…

Is this the full script?
$chld3 & co. are undefined, must be declared like on login
Yes my humble sir, the 1st post above is the whole script. for login and logout.

Maybe some syntax might be read wrong by routeros. i have tried different approach it doesnt work my humble sir
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Custom hotspot logout script issues ROS 7.7

Tue Feb 07, 2023 7:37 pm

This is my last message, you do not read, you do not understand.

$chld3, $chld2, $chld1 and $qname on logout script are undefined, must be declared like on login script

Who is online

Users browsing this forum: JDF and 26 guests