pls help how to print all profile name with starts with the name FIBR
i have a script but it print only 1
:put ([/ppp profile print as-value where name~"FIBR"] ->1->"name")
:foreach Profile in=[/ppp profile find where name~"FIBR"] do={:put [/ppp profile get $Profile]}
/ppp profile
:foreach Profile in=[find where name~"FIBR"] do={
:put [/ppp profile get $Profile]
}
{
/ppp profile
:foreach Profile in=[find where name~"FIBR"] do={
:put [/ppp profile get $Profile]
}
}
/ppp profile
:foreach profID in=[find where name~"FIBR"] do={
:put [get $profID name]
}
/ppp profile
:foreach profID in=[find where name~"^FIBR"] do={
:put [get $profID name]
}
name~"(?i)fibr"
name~"(\?i)fibr"
/tool sms send phone-number=056698885 message="test"
/ppp profile
:foreach profID in=[find where name~"FIBR"] do={
:log warning message="send $[get $profID name] to SMS"
/tool sms send phone-number=056698885 message=[/ppp profile get $profID name]
}
{
/ppp profile
:local allprofiles ""
:foreach profID in=[find where name~"FIBR"] do={
:if ($allprofiles="") do={ :set allprofiles [get $profID name] } else={ :set allprofiles "$allprofiles,$[get $profID name]" }
}
:log warning message="send $allprofiles to SMS"
/tool sms send phone-number=056698885 message=$allprofiles
}
/ppp profile
:foreach profID in=[find where name~"FIBR"] do={
:local profname [get $profID name]
# 5 is the lenght of prefix FIBR including space
:set profname [:pick $profname ([:find $profname "FIBR "] + 5) [:len $profname]]
:log warning message="send $profname to SMS"
/tool sms send phone-number=056698885 message=$profname
}
{
/ppp profile
:local allprofiles ""
:foreach profID in=[find where name~"FIBR"] do={
:local profname [get $profID name]
# 5 is the lenght of prefix FIBR including space
:set profname [:pick $profname ([:find $profname "FIBR "] + 5) [:len $profname]]
:if ($allprofiles="") do={ :set allprofiles [get $profID name] } else={ :set allprofiles "$allprofiles,$profname" }
}
:log warning message="send $allprofiles to SMS"
/tool sms send phone-number=056698885 message=$allprofiles
}