完善极光配置,格式化代码
This commit is contained in:
23
scripts/jg/rmroute.rsc
Normal file
23
scripts/jg/rmroute.rsc
Normal file
@@ -0,0 +1,23 @@
|
||||
: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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user