Hotspot Users
Hotspot On-Logout: Disconnect Shared Sessions — 6
Paste into a hotspot user profile’s On Logout field. When a session ends because a limit was reached, all other active sessions of the same user are removed immediately.
RouterOS 6
# EN: $cause and $user are filled in automatically by the hotspot when a user logs out
# AR: المتغيران $cause و $user يملؤهما الهوتسبوت تلقائياً عند خروج المستخدم
# EN: Remove the last two conditions if you only want traffic-limit logouts
# AR: احذف آخر شرطين إذا أردت الفصل عند انتهاء حد البيانات فقط
:if (($cause="traffic limit reached") || ($cause="uptime limit reached") || ($cause="session timeout")) do={
:local userName "$user"
# EN: Find the remaining active sessions of this user | AR: البحث عن باقي الجلسات النشطة لهذا المستخدم
:local activeSessions [/ip hotspot active find where user=$userName]
:foreach session in=$activeSessions do={
# EN: Disconnect them | AR: فصلها
/ip hotspot active remove $session
}
}