Community discussions

 
Ciambot
Member Candidate
Member Candidate
Topic Author
Posts: 144
Joined: Thu Jan 22, 2009 5:22 pm

check ip enabled or not

Fri Jul 13, 2018 1:18 pm

Hi,
I'd like to check if an ip address is enable or disable through script.
How can I achieve this?

example
- :if (ip address get [find address="x.x.x.x/x"] disabled = yes) do={ ...
- :if (ip address get [find address="x.x.x.x/x"] enabled = yes) do={ ...


Thanks.
 
User avatar
dasiu
Trainer
Trainer
Posts: 232
Joined: Fri Jan 30, 2009 11:41 am
Location: Reading, UK
Contact:

Re: check ip enabled or not  [SOLVED]

Fri Jul 13, 2018 3:47 pm

Hi,
I'd like to check if an ip address is enable or disable through script.
How can I achieve this?

example
- :if (ip address get [find address="x.x.x.x/x"] disabled = yes) do={ ...
- :if (ip address get [find address="x.x.x.x/x"] enabled = yes) do={ ...


Thanks.
Almost great, just work on the brackets:
:if ([/ip address get [find address="x.x.x.x/x"] disabled]) do={
  :put "The address is disabled!";
} else={
  :put "The address is enabled!";
}
 
Ciambot
Member Candidate
Member Candidate
Topic Author
Posts: 144
Joined: Thu Jan 22, 2009 5:22 pm

Re: check ip enabled or not

Sat Jul 14, 2018 5:41 pm

It works!
Thanks a lot!

Who is online

Users browsing this forum: No registered users and 12 guests