Automated script to restart Dockers in priority when network is re-connected


Recommended Posts

Hey!
I have a setup that looks like this;

 

VPN Docker 1
Docker 1 (runs under vpn docker 1)
Docker 2 (runs under vpn docker 1)

VPN Docker 2

Docker 3 (runs under vpn docker 2)

Docker 4 (runs under vpn docker 2)

 

When my network disconnect, vpn dockers activates their killswitch, witch is good - but bad for me.. bc then i have to manually restart every docker including the vpn dockers.. 

 

Is there someway to make a script that maybe detects when network is lost and shuts down the dockers, and then when network is up and running again, starts both vpn dockers at the same time, and 30 sec later starts the other dockers (so the vpn is connected)

 

I was checking if there was something that could be done by using this script, but i can't really get the detection part figured out... since this activates when unraid is restarted. 

 

 

Thanks!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.