From 5df89e7f89a5e37cd44aafed9466b19f4d0cf82c Mon Sep 17 00:00:00 2001 From: mercury Date: Mon, 4 Mar 2024 16:51:18 +0400 Subject: [PATCH] syncport fix --- app/bot.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/bot.php b/app/bot.php index 922c263..aa78f75 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4002,14 +4002,20 @@ DNS-over-HTTPS with IP: public function syncPortClients() { - $endpoint = $this->ip . ':' . getenv('WGPORT'); - $clients = $this->readClients(); - foreach ($clients as $k => $v) { - foreach ($v['peers'] as $i => $j) { - $clients[$k]['peers'][$i]['Endpoint'] = $endpoint; + $endpoint = [ + $this->ip . ':' . getenv('WGPORT'), + $this->ip . ':' . getenv('WG1PORT'), + ]; + for ($i=0; $i < 2; $i++) { + $this->wg = $i; + $clients = $this->readClients(); + foreach ($clients as $k => $v) { + foreach ($v['peers'] as $i => $j) { + $clients[$k]['peers'][$i]['Endpoint'] = $endpoint[$i]; + } } + $this->saveClients($clients); } - $this->saveClients($clients); } public function saveClients(array $clients)