Ad Schellevis
2023-10-20 17:57:51 +02:00
parent 7ff3c44957
commit 0558d48493
2 changed files with 3 additions and 10 deletions
@@ -46,15 +46,6 @@ class ServiceController extends ApiMutableServiceControllerBase
protected static $internalServiceEnabled = 'enabled';
protected static $internalServiceName = 'wireguard';
/**
* hook group interface registration on reconfigure
* @return bool
*/
protected function invokeInterfaceRegistration()
{
return true;
}
/**
* @return array
*/
@@ -66,6 +57,7 @@ class ServiceController extends ApiMutableServiceControllerBase
$this->sessionClose();
$backend = new Backend();
$backend->configdRun('interface invoke registration');
$backend->configdRun('template reload ' . escapeshellarg(static::$internalServiceTemplate));
$backend->configdpRun('wireguard configure');
@@ -29,6 +29,7 @@
require_once('script/load_phalcon.php');
require_once('util.inc');
require_once('config.inc');
require_once('interfaces.inc');
/**
@@ -121,6 +122,7 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up')
ftruncate($fhandle, 0);
fwrite($fhandle, @md5_file($server->cnfFilename) . "|" . wg_reconfigure_hash($server));
syslog(LOG_NOTICE, "Wireguard interface {$server->name} ({$server->interface}) started");
interfaces_restart_by_device(false, [(string)$server->interface], false);
}
/**
@@ -263,6 +265,5 @@ if (isset($opts['h']) || empty($args) || !in_array($args[0], ['start', 'stop', '
}
}
}
mwexecf('/usr/local/etc/rc.routing_configure');
}
closelog();