:global a;
:global y;
:global v;
:global status;
:local wann "";
:local wanr "";
:local cnam "";
:set y 0;
:set v 0;
/int pppoe-c ;
:foreach ap in=[find comment="" running=yes] do={
:set y ($y + 1);
}
:if ($a != $y) do={
/int pppoe-c;
:foreach sp in=[find comment="tel"] do={
:set wanr [get $sp running];
:set wann [get $sp name];
:set cnam [:pick $wann 9 20];
:if ($wanr=yes) do={
/ip fir man set [/ip fir man find comment=("C"."$cnam")] per-connection-classifier=("both-addresses-and-port:" . $y . "/" . $v) disabled=no;
:set v ($v + 1)} else={
/ip fir man set [/ip fir man find comment=("C" . "$cnam")] disabled=yes;
}}}
:set a $y;