Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21075

Scripting • Delay start of the adguard container

$
0
0
I'm running adguard container on 5009. The problem is, that when we have power loss (and that happens quite often) adguard doesn't load properly after power restore and i must reboot the 5009 once more. I'm guessing this happens because 5009 boots faster than modem gets back fiber connection and in causes some error on adguard.

Is there any way to delay start of the adguard container for example 2 minutes after reboot?

I tried wiith Chat GPT and got this, but it seems that it doesn't work:

add dont-require-permissions=no name=delayed_start_adguard owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive source="# D\
elayed start of AdGuard container\
\n# Sleep for 2 minutes (120 seconds)\
\n:delay 120s;\
\n\
\n# Start the AdGuard container here\
\n/system docker start name=adguard;"


and


/system scheduler
add name=Adguard_delay on-event=delayed_start_adguard policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-time=startup


there is another option to enable use peer dns after power failure and reboot, and when i manage i can then fix the issue manualy. Another reboot to get the adguard going and disabling peer dns on DHCP client.

What would be the best approach?

Statistics: Posted by dcavni — Wed Dec 20, 2023 2:34 pm



Viewing all articles
Browse latest Browse all 21075

Trending Articles