Basic script help!

Hi

:foreach i in=[/interface find type=ether] do = {
:put [/interface get $i name]
:log info [/interface get $i name]
}

Works fine.

BUT

:foreach i in=[/ip/pool/used find pool=hs-pool-2] do = {
:put [/ip/pool/used get $i address]
:log info [/iip/pool/used get $i address]
}

Doesnt. Can anyone help me with my mistake??

rgds
Jim Heck
MilNet UK

Try this:

:foreach i in=[/ip/pool/used [find pool=hs-pool-2]] do = {
:put [/ip/pool/used get $i address]
:log info [/ip/pool/used get $i address]
}

Hi skillful,

Nope, still does work!

thanks and rgds
Jim

It seems there is no FIND command under /ip pool used … so I am not sure this is an easy one …

Sam

Hi Sam,

OK how about this one

:foreach i in=[/ip/hotspot/host find server=hotspot1] do = {:log info [/ip/hotspot/host get $i address]}

doesnt seem to work either!"

rgds
Jim

Try this:

:foreach i in=[/ip hotspot host find server=hotspot1] do = {:log info [/ip hotspot host get $i address]}

Just copy and paste.

Hi Skillfull,

Ah Ah!

:foreach i in=[/ip hotspot host find server=hotspot1] do = {:log info [/ip hotspot host get $i address]}

Works perfectly. Success after a days work. This scripting business is hard to learn! MANY thanks for your help!

Jim

what does this script do?

kanch,

It doesnt do much, just writes the IP addresses listed in the hotspot system into the log. The only reason I wanted to get it working was to learn the syntax of the scripting language.

rgds
Jim Heck