mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 16:14:40 +00:00
wireguard: move route reconfigure to wg_start
we shouldn't attempt to reconfigure the system routes if wireguard isn't enabled.
This commit is contained in:
parent
845ba727c8
commit
c2d07aeef6
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user