diff --git a/app/Services/Wireguard/LocalWireguardHub.php b/app/Services/Wireguard/LocalWireguardHub.php index 9021c94..7433a7b 100644 --- a/app/Services/Wireguard/LocalWireguardHub.php +++ b/app/Services/Wireguard/LocalWireguardHub.php @@ -33,13 +33,13 @@ class LocalWireguardHub implements WireguardHub public function addPeer(string $publicKey, string $ip): void { Process::run(['wg', 'set', 'wg0', 'peer', $publicKey, 'allowed-ips', $ip.'/32'])->throw(); - Process::run('wg-quick save wg0'); + Process::run('wg-quick save wg0')->throw(); // persist, else the peer is lost on restart } public function removePeer(string $publicKey): void { Process::run(['wg', 'set', 'wg0', 'peer', $publicKey, 'remove'])->throw(); - Process::run('wg-quick save wg0'); + Process::run('wg-quick save wg0')->throw(); // persist, else the peer is lost on restart } public function endpoint(): string