Remove /ppp secret entries

Hi there,

I wish to remove secret entries. I got this code:

/ppp secret { :foreach i in [find] do={print; remove 0}}

After second iteration, remove 0 doesnt work anymore...
Can anyone help?
Thanks


it runs:

[admin@xxx] ppp secret> /ppp secret { :foreach i in [find] do={/ppp secret print; /ppp secret remove 0;} }

Flags: X - disabled

NAME SERVICE CALLER-ID PASSWORD PROFILE REMOTE-ADDRESS

0 flie2 pppoe teste pppoe-300
1 flip pppoe teste pppoe-300
2 ie2 pppoe teste pppoe-300

Flags: X - disabled

NAME SERVICE CALLER-ID PASSWORD PROFILE REMOTE-ADDRESS

0 flip pppoe teste pppoe-300
1 ie2 pppoe teste pppoe-300
no such item (4)
[admin@xxx] ppp secret>

If you just want to delete all ppp secrets, use this:

/ppp secret remove [/ppp secret find]

The reason is that (at least in the 2.9 software series of RouterOS) you may not use the item numbers (like 0) you see in a print in a script command.

Best regards,
Christian Meis

tnx, CMIT!

I was using:

:log info “clear_pppoe_secrets: start”
/ppp secret
:foreach i in [ find ] do={ remove $i } ;
:log info “clear_pppoe_secrets: end”


which also worked.

regards,

Chemichon