23 lines
775 B
Plaintext
23 lines
775 B
Plaintext
:foreach i in=[/ip firewall mangle find chain=prerouting] do={
|
|
:local ipComm [/ip firewall mangle get $i src-address]
|
|
:local activeConnLen [:len [/ppp active find address=$ipComm]]
|
|
:local routerlen [:len [/ip firewall mangle find src-address=$ipComm]]
|
|
:if ($activeConnLen=0) do={
|
|
/ip firewall mangle remove $i
|
|
}
|
|
:if ($routerlen>1) do={
|
|
/ip firewall mangle remove $i
|
|
}
|
|
}
|
|
|
|
:foreach i in=[/routing rule find] do={
|
|
:local ipComm [/routing rule get $i comment]
|
|
:local activeConnLen [:len [/ppp active find address=$ipComm]]
|
|
:local routerlen [:len [/routing rule find comment=$ipComm]]
|
|
:if ($activeConnLen=0) do={
|
|
/routing rule remove $i
|
|
}
|
|
:if ($routerlen>1) do={
|
|
/routing rule remove $i
|
|
}
|
|
} |