mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
Fix: PHP error when changing container network if wireguard isn't enabled
This commit is contained in:
4
emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php
Normal file → Executable file
4
emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php
Normal file → Executable file
@@ -1094,8 +1094,8 @@ _(Network Type)_:
|
||||
$n = $x ? 1 : 0; while (isset($$eth["VLANID:$n"]) && $$eth["VLANID:$n"] != $x) $n++;
|
||||
if (!empty($$eth["DESCRIPTION:$n"])) $name .= ' -- '.compress(trim($$eth["DESCRIPTION:$n"]));
|
||||
} elseif (preg_match('/^wg[0-9]+$/',$network)) {
|
||||
$conf = file("/etc/wireguard/$network.conf");
|
||||
if ($conf[1][0]=='#') $name .= ' -- '.compress(trim(substr($conf[1],1)));
|
||||
$conf = is_file("/etc/wireguard/$network.conf") ? file("/etc/wireguard/$network.conf") : [];
|
||||
if ( ($conf[1][0]??'')=='#') $name .= ' -- '.compress(trim(substr($conf[1],1)));
|
||||
} elseif (substr($network,0,4)=='wlan') {
|
||||
$name .= ' -- '._('Wireless interface');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user