هوتسبوت

سكربت On-Logout: فصل الجلسات المشتركة — 6

يُوضع في خانة On Logout داخل بروفايل المستخدم. عند انتهاء جلسة بسبب الوصول لحد معين، يتم فصل باقي الجلسات النشطة لنفس المستخدم فوراً.

إصدار ⁨MikroTik⁩

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
    }
}