pppooe uptime log

what is wrong with this script that does not log the up time in “if” statement and passes to reach the “else” statement and says its down

:local pppoeInterface “pppoe-out1”
:local interfaceStatus [/interface get $pppoeInterface running]
:local uptime

:put ("Interface Status: " . $interfaceStatus)

:if ($interfaceStatus = true) do={
:local uptimeValue [/interface get $pppoeInterface uptime]
:set uptime ("PPPoE interface " . $pppoeInterface . " is UP. Uptime: " . $uptimeValue)
} else={
:set uptime (“PPPoE interface " . $pppoeInterface . " is DOWN.”)
}

:log info $uptime
[/b][/i][/i][/u][/u]

It’s full of errors and invented commands. Did you ask StupidGPT for the script???

{
/interface
:local ifname “pppoe-out1”
:local ifget [get $ifname]
:local ifdown ($ifget->“last-link-down-time”)
:local ifup ($ifget->“last-link-up-time”)
:local ifrun ($ifget->“running”)
:local iftime “00:00:00”
:local logstr “”

:if ($ifrun) do={
    :set iftime ([pppoe-client monitor $ifname once as-value]->"uptime")
    :set logstr ("$ifname UP from $ifup for $iftime")
} else={
    :set logstr ("$ifname DOWN from $ifdown")
}

:log info $logstr

}

it will be easier to use profiles in ppp for this

http://forum.mikrotik.com/t/ppp-profile-scripts/155723/1