mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
wg - fix error when empty tunnel address in instance (#3638)
This commit is contained in:
parent
96b47255be
commit
837de4771e
@ -69,7 +69,8 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up')
|
||||
}
|
||||
mwexecf('/usr/bin/wg setconf %s %s', [$server->interface, $server->cnfFilename]);
|
||||
|
||||
foreach (explode(',', (string)$server->tunneladdress) as $alias) {
|
||||
/* The tunneladdress can be empty, so array_filter without callback filters empty strings out. */
|
||||
foreach (array_filter(explode(',', (string)$server->tunneladdress)) as $alias) {
|
||||
$proto = strpos($alias, ':') === false ? "inet" : "inet6";
|
||||
mwexecf('/sbin/ifconfig %s %s %s alias', [$server->interface, $proto, $alias]);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user