Can anyone help?
This script can’t running up ver6.x.
What’s wrong?
Thanks so much!
czjlj
:local newaddress
:local newnetwork
:local assignip
:local status
:local pppoestatus
:local pppoeup
:local pppoeupcount
:local pppoedown
:local pppoedowncount
:local x
:set x [:len [/interface pppoe-client find running]]
:set pppoeupcount 0
:set pppoedowncount 0
:log info (PPPOE-OUT LineCheck)
:log info (PPPOEoe-out Status Remote Address Local Address )
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=(pppoe-out . $i)] running]
:if ($status=true) do={
:set newnetwork [/ip address get [/ip address find dynamic=yes interface=(pppoe-out . $i)] network]
:set pppoestatus [/ping 8.8.8.8 count=2 interface=(pppoe-out . $i)]
:if ($pppoestatus=1) do={
:log info (pppoe-out . $i.rebooting......)
:beep
:/int pppoe-client disable (pppoe-out . $i)
:delay 2
:/int pppoe-client enable (pppoe-out . $i)
:delay 5
:if ($pppoedowncount=0) do={:set pppoedown [($pppoedown .pppoe-out . $i)]}
:if ($pppoedowncount0) do={:set pppoedown [($pppoedown .; pppoe-out . $i)]}
:set pppoedowncount ($pppoedowncount + 1)}
:if ($pppoestatus1) do={
:if ($pppoeupcount=0) do={:set pppoeup [($pppoeup .pppoe-out . $i)]}
:if ($pppoeupcount0) do={:set pppoeup [($pppoeup .; pppoe-out . $i)]}
:set pppoeupcount ($pppoeupcount + 1)}
:set newaddress [/ip address get [/ip address find dynamic=yes interface=(pppoe-out . $i)] address]
:log info (pppoe-out . $i. .$pppoestatus . . $newnetwork . .$newaddress )}}
:log info (PPPOE-Client LineCheck Finish,Total. $pppoedowncount+$pppoeupcount .)
:if ($pppoeupcount=0) do={:log info Offline PPPOE-CLient!}
:if ($pppoeupcount0) do={:log info (Online . $pppoeupcount . $pppoeup)}
:if ($pppoedowncount=0) do={:log info ALL PPPOE-CLient Online!}
:if ($pppoedowncount0) do={:log info (Offline Total . $pppoedowncount . Autofix . $pppoedown)}
:beep length=0.5s
:delay 1
:beep