Skip to content

Commit

Permalink
net/wireguard: hook up 'vpn' configuration facility using 'renew' act…
Browse files Browse the repository at this point in the history
…ion #3565
  • Loading branch information
fichtner committed Aug 31, 2023
1 parent 90a16b1 commit d6df03a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc
Expand Up @@ -102,3 +102,23 @@ function wireguard_devices()
{
return [['pattern' => '^wg', 'volatile' => true]];
}

function wireguard_configure()
{
return [
'vpn' => ['wireguard_configure_do:2'],
];
}

function wireguard_configure_do($verbose = false, $unused = '')
{
if (!wireguard_enabled()) {
return;
}

service_log('Configuring WireGuard VPN...', $verbose);

configd_run('wireguard renew');

service_log("done.\n", $verbose);
}

0 comments on commit d6df03a

Please sign in to comment.