Hotspot Users
Bulk Change Hotspot User Comment โ 6
Finds every hotspot user that has a given comment (usually a batch/card series name) and replaces it with a new comment.
RouterOS 6
# EN: Old comment to search for | AR: ุงูููู
ูุช ุงููุฏูู
ุงูู
ุฑุงุฏ ุงูุจุญุซ ุนูู
:local targetComment "change here";
# EN: New comment to apply | AR: ุงูููู
ูุช ุงูุฌุฏูุฏ ุงูู
ุฑุงุฏ ุชุทุจููู
:local newComment "change here";
# EN: Safety check - stops if variables were not edited | AR: ุญู
ุงูุฉ - ูุชููู ุงูุณูุฑุจุช ุฅุฐุง ูู
ูุชู
ุชุนุฏูู ุงูู
ุชุบูุฑุงุช
:if ($targetComment = "change here" || $newComment = "change here") do={ :error "Edit the variables first" }
# EN: Loop over all users that have the old comment | AR: ุงูู
ุฑูุฑ ุนูู ูู ุงูู
ุณุชุฎุฏู
ูู ุงูุฐูู ูุฏููู
ุงูููู
ูุช ุงููุฏูู
:foreach u in=[/ip hotspot user find where comment=$targetComment] do={
# EN: Set the new comment | AR: ูุถุน ุงูููู
ูุช ุงูุฌุฏูุฏ
/ip hotspot user set $u comment=$newComment
}