Hotspot Users
Bulk Change Uptime Limit by Comment — 7
Sets a new uptime limit (limit-uptime) for all hotspot users that share the same comment.
RouterOS 7
# EN: Comment of the batch to modify | AR: كومنت الدفعة المراد تعديلها
:local targetComment "change here";
# EN: New uptime limit as a time value. Examples: 30m, 10h, 12h, 1d, 1d12h, 0s = unlimited (write it WITHOUT quotes)
# AR: حد الوقت الجديد. أمثلة: 30m (30 دقيقة)، 10h (10 ساعات)، 12h (نصف يوم)، 1d (يوم)، 0s (بدون حد) - اكتبه بدون علامات اقتباس
:local newUptime "change here";
# EN: Safety check | AR: حماية من عدم تعديل المتغيرات
:if ($targetComment = "change here" || [:typeof $newUptime] != "time") do={ :error "Edit the variables first" }
# EN: Loop over all users with this comment | AR: المرور على كل المستخدمين بهذا الكومنت
:foreach u in=[/ip hotspot user find where comment=$targetComment] do={
# EN: Apply the new uptime limit | AR: تطبيق حد الوقت الجديد
/ip hotspot user set $u limit-uptime=$newUptime
}