Changes between Version 20 and Version 21 of RB1100AHX4


Ignore:
Timestamp:
12/23/25 15:26:35 (2 weeks ago)
Author:
krit
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RB1100AHX4

    v20 v21  
    340340 
    341341}}}
     342
     343script for check_running container
     344{{{
     345[admin@MK53] /system/script> print where name=check_container
     346Flags: I - invalid
     347 1   name="check_container" owner="admin"
     348     policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
     349     dont-require-permissions=no last-started=2025-12-23 06:20:44 run-count=11 source=
     350       {
     351           :local containerName "alpine"
     352           :local cont [/container find name=$containerName]
     353       
     354           :if ([:len $cont] = 0) do={
     355               :put "Container '$containerName' does NOT exist."
     356               :log warning "Container '$containerName' does NOT exist."
     357           } else={
     358               :local isRunning [/container print count-only where name=$containerName and runni>
     359       
     360               :if ($isRunning = 1) do={
     361                   :put "Container '$containerName' is RUNNING."
     362               } else={
     363                   :put "Container '$containerName' is NOT running."
     364               }
     365           }
     366       }
     367 
     368[admin@MK53] /system/script>
     369
     370}}}