diff --git a/scripts/firmware-check-lte.rsc b/scripts/firmware-check-lte.rsc index 73e4db9..7b61804 100644 --- a/scripts/firmware-check-lte.rsc +++ b/scripts/firmware-check-lte.rsc @@ -8,7 +8,8 @@ # $adminEmail :global adminEmail -:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={ :log error "adminEmail is not defined or nil."; :error "Error: Check the log"; } +:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={ + :log error "adminEmail is not defined or nil."; :error "Error: Check the log"; } :log info "\nChecking for new firmware for LTE Modem..." diff --git a/scripts/ros6-lteLogger2.rsc b/scripts/ros6-lteLogger2.rsc new file mode 100644 index 0000000..41f7a35 --- /dev/null +++ b/scripts/ros6-lteLogger2.rsc @@ -0,0 +1,41 @@ +# Source: https://forum.mikrotik.com/viewtopic.php?t=178312 + +/system script job remove [find script=lteLogger2] + +/system scheduler +remove [find name=lteLogger2] +add interval=1m name=lteLogger2 on-event="#Script WatchDog for script name:\r\ + \nlocal ScriptName lteLogger2\r\ + \n\r\ + \n\r\ + \nlocal ScriptRuningInstances [:len [system script job find script=\$ScriptName]]\r\ + \nif ( \$ScriptRuningInstances = 0) do={/system script run \$ScriptName};\r\ + \nif ( \$ScriptRuningInstances = 1) do={};\r\ + \nif ( \$ScriptRuningInstances >= 2) do={system script job remove [find script=\$ScriptName]};\r\ + \n\r\ + \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=dec/23/2019 start-time=07:31:44 + + +/system script +remove [find name=lteLogger2] +add name=lteLogger2 source="#:local watchItems pin-status,functionality,registra\ + tion-status,current-cellid,enb-id,sector-id,phy-cellid,access-technology,primary-band,ca-band,rssi\r\ + \n:local watchItems current-cellid,enb-id,primary-band,ca-band\r\ + \n:local watchFreq 3s\r\ + \n:local lteInfo\r\ + \n:local prevLteInfo ({})\r\ + \n:while (true) do={\r\ + \n\t:do {:set lteInfo [/interface lte info lte1 once as-value]} on-error={}\r\ + \n\t:foreach m in=\$watchItems do={\r\ + \n\t\t:if ((\$lteInfo->\$m)!=(\$prevLteInfo->\$m)) do={\r\ + \n\t\t\t:put (\$m.\": \".(\$prevLteInfo->\$m).\" -> \".(\$lteInfo->\$m))\r\ + \n\t\t\t:log warning (\$m.\": \".(\$prevLteInfo->\$m).\" -> \".(\$lteInfo->\$m))\r\ + \n\t\t\tlocal mpprev (\$prevLteInfo->\$m);\r\ + \n\t\t\tlocal mpnext (\$lteInfo->\$m);\r\ + \n\t\t\t:set (\$prevLteInfo->\$m) (\$lteInfo->\$m)\r\ + \n\t\t\t}\r\ + \n\t\t}\r\ + \n\t:delay \$watchFreq\r\ + \n\t}\r\ + \n\r\ + \n" diff --git a/scripts/sms-to-email.rsc b/scripts/sms-to-email.rsc index 069c9a5..b0c28f2 100644 --- a/scripts/sms-to-email.rsc +++ b/scripts/sms-to-email.rsc @@ -6,7 +6,8 @@ # even if email and forward fail! So, test it often! :global adminEmail -:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={ :log error "adminEmail is not defined or nil."; :error "Error: Check the log"; } +:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={ + :log error "adminEmail is not defined or nil."; :error "Error: Check the log"; } :local smsPhone :local smsMessage diff --git a/scripts/sms-to-sms.rsc b/scripts/sms-to-sms.rsc index cf0facc..657479e 100644 --- a/scripts/sms-to-sms.rsc +++ b/scripts/sms-to-sms.rsc @@ -5,9 +5,10 @@ # Source: https://forum.mikrotik.com/viewtopic.php?f=9&t=61068#p312202 :global adminPh -:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={ :log error "adminEmail is not defined or nil."; :error "Error: Check the log"; } +:if ([:typeof $adminPh] = "nothing" || $adminPh = "") do={ + :log error "adminPh is not defined or nil."; :error "Error: Check the log"; } + :local smsForwardPh $adminPh -:if ([:typeof $adminPh] = "nothing" || $adminPh = "") do={ :log error "adminPh is not defined or nil."; :error "Error: Check the log"; } :local smsPhone :local smsMessage