simple help with if and &&

I want to see if my modem is connected and also enable
I have done this :

:global run [/interface get ppp-out1 running];
:global work [/interface get ppp-out1 disabled]
:put $run 
true
:put $work
false
if ($run="true"&&work="false") do={:log warning "yessss"} else={:log warning "noooo"}

and I get “noooooo”,
am I doing it right? or I miss something in the writing of the command ?

Thanks ,

I’m missing a $ on the “if” line, before “work”, i.e. replace

if ($run="true"&&work="false")

with

if ($run="true" && $work="false")

Also, I think you probably want a Boolean true/false values, not string equivalents (I’m not 100% if RouterOS treats them as you’d expect), i.e. if the above fails, also try

if ($run=true && $work=false)

my mistake
great