From 486c9a862ac8b52d058cac1cc49ffac0751ebfc3 Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Sat, 24 Jan 2026 21:16:57 +0300 Subject: [PATCH] Fix: Add missing $ in sync script and skip invalid clients --- scripts/sync_awg_all.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/sync_awg_all.php b/scripts/sync_awg_all.php index cd0f809..ce19dde 100644 --- a/scripts/sync_awg_all.php +++ b/scripts/sync_awg_all.php @@ -98,6 +98,10 @@ try { foreach ($clients as $client) { $pub = $client['public_key']; + if (empty($pub)) { + echo "Skipping client {$client['id']} (Empty Public Key)\n"; + continue; + } $psk = $client['preshared_key']; $ip = $client['client_ip']; $allowed = $client['allowed_ips'] ?? "$ip/32"; // Fallback to IP/32 @@ -110,8 +114,8 @@ try { } // 5. Write Config - // Use host path if possible for safety - $hostConfPath = '/opt/amnezia/amnezia-awg/wg0.conf'; + // Use host path that matches container volume (-v /opt/amnezia/awg:/opt/amnezia/awg) + $hostConfPath = '/opt/amnezia/awg/wg0.conf'; $escaped = addslashes($conf); $server->executeCommand("echo \"$escaped\" > $hostConfPath", true);