mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/wireguard: hook up 'newwanip' and 'vpn' facilities #3565
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
PLUGIN_NAME= wireguard
|
||||
PLUGIN_VERSION= 2.0
|
||||
PLUGIN_REVISION= 2
|
||||
PLUGIN_VERSION= 2.1
|
||||
PLUGIN_COMMENT= WireGuard VPN service kernel implementation
|
||||
PLUGIN_DEPENDS= wireguard-kmod
|
||||
PLUGIN_CONFLICTS= wireguard-go
|
||||
|
||||
@@ -102,3 +102,37 @@ function wireguard_devices()
|
||||
{
|
||||
return [['pattern' => '^wg', 'volatile' => true]];
|
||||
}
|
||||
|
||||
function wireguard_configure()
|
||||
{
|
||||
return [
|
||||
'newwanip' => ['wireguard_renew:2'],
|
||||
'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 configure');
|
||||
|
||||
service_log("done.\n", $verbose);
|
||||
}
|
||||
|
||||
function wireguard_renew($verbose = false, $unused = '')
|
||||
{
|
||||
if (!wireguard_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
service_log('Renewing WireGuard VPN...', $verbose);
|
||||
|
||||
configd_run('wireguard renew');
|
||||
|
||||
service_log("done.\n", $verbose);
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
configctl -dq wireguard configure
|
||||
Reference in New Issue
Block a user