Hello All!
First post so go easy on me ![]()
I have been using my RB2011UiAS for several months and read a lot of manuals and wiki pages for my 'tik and love it. I am now starting to play around with scripts and need a little help/guidance with understanding the syntax thatâs probably pretty simple for most.
I am basically trying to use an alternative to netwatch ping failover. The âif pingâ commands work stand alone in terminal but when I combine it into the following script the script doesnât make it to the end. I do not get the email and the log entry âfinishâ doesnât appear. I have read most of the scripting/functions wiki pages but I donât believe I have it structured right, as I said itâs probably something Iâve over looked a few times and would appreciate some input.
#Set needed variables
:local var
#used for testing purposes to test logic below
:set var false
#used for debugging
:log info ("variable is = $var");
:if ($var = false) do={
:log info "Start"
:if ([/ping 192.168.1.1 count=5] = 0) do={
/tool e-mail send to="xxx@xxx.com" subject="xxx" body="xxxx"}
:log info "finish"
} else={:log info "else executed"}