r/protonvpn: watchdog: reconfigure at startup
If the remote address configuration for strongSwan is not valid when the Proton VPN watchdog starts, it will now regenerate it immediately. This can happen, for example, if the Internet has been down for a while, and the watchdog has iterated through all of the servers in the cache. Restarting the service will now force it to reconfigure the tunnel and bring the VPN back up.ntfy
parent
328f2fa586
commit
19330ac555
|
@ -174,6 +174,16 @@ class AsyncDaemon(BaseAsyncDaemon):
|
|||
async def manage_serverlist(self) -> None:
|
||||
while 1:
|
||||
self.serverlist = await self.get_serverlist()
|
||||
try:
|
||||
st = os.stat(self.CONFIG)
|
||||
except FileNotFoundError:
|
||||
await self.reconfigure()
|
||||
except OSError as e:
|
||||
log.error('Error checking config file attributes: %s', e)
|
||||
await self.reconfigure()
|
||||
else:
|
||||
if st.st_size < 10:
|
||||
await self.reconfigure()
|
||||
await asyncio.sleep(3600 + random.randint(0, 900))
|
||||
|
||||
def mark_bad(self, addr: str) -> None:
|
||||
|
|
Loading…
Reference in New Issue