Code: Select all
# Define the list of specific users
:local userList {"user1"; "user2"; "user3"}
# Iterate over all hotspot users
:foreach user in=[/ip hotspot user find] do={
:local userName [/ip hotspot user get $user name]
# Check if the user is in the specified user list
:if ([:find $userList $userName] != -1) do={
# Reset the user's counters
/ip hotspot user reset-counters $user
:log info ("Counters for user " . $userName . " have been reset")
}
}