Hello,
I want to make a script that notify my whenever there is a user call “david” in the Hotspot-Users
I have try something like this
if ([:tobool[/ip hotspot user get [find name=david]] = true]) do={/system scripts run yes} else={/system scripts run no}
foreach i in=[ip hotspot user find ] do={
local user [ip hotspot user get value-name=name $i]
local name david
if ($user = $name ) do={beep length=3}
}
thanks - it’s working almost …
When I try to add an else section it’s doesn’t give me
foreach i in=[ip hotspot user find ] do={
local user [ip hotspot user get value-name=name $i]
local name ronen
if ($user = $name ) do={beep length=3};
else={beep length=1};
};
foreach i in=[ip hotspot user find ] do={
local user [ip hotspot user get value-name=name $i]
local name ronen
if ($user = $name ) do={beep length=3} else={beep length=1};
}
I have change 1 thing and now it’s not good
when I run this script I get the 2 messages if there is a user called david
and if not I get the "Not good " message
???
foreach i in=[ip hotspot user find ] do={
local user [ip hotspot user get value-name=name $i]
local name david
if ($user = $name ) do={/log warning "hotspot user O.K"} else={/log warning "Not Good"};
}