mirror of
https://github.com/unraid/webgui.git
synced 2026-05-05 11:50:41 -05:00
New vhost network for both containers and VMs
This commit is contained in:
@@ -47,13 +47,13 @@ $host = ipaddr($ethX);
|
||||
$driver = DockerUtil::driver();
|
||||
|
||||
// determine active port name
|
||||
$port = file_exists('/sys/class/net/br0') ? 'BR' : (file_exists('/sys/class/net/bond0') ? 'BOND' : 'ETH');
|
||||
$port = file_exists('/sys/class/net/br0') ? 'BR0' : (file_exists('/sys/class/net/bond0') ? 'BOND0' : 'ETH0');
|
||||
|
||||
// Docker configuration file - guaranteed to exist
|
||||
$docker_cfgfile = '/boot/config/docker.cfg';
|
||||
if (file_exists($docker_cfgfile) && exec("grep -Pom1 '_{$port}[0-9]+(_[0-9]+)?=' $docker_cfgfile")=='') {
|
||||
if (file_exists($docker_cfgfile) && exec("grep -Pom1 '_{$port}(_[0-9]+)?=' $docker_cfgfile")=='') {
|
||||
# interface has changed, update configuration
|
||||
exec("sed -ri 's/_(BR|BOND|ETH)([0-9]+(_[0-9]+)?)=/_{$port}\\2=/' $docker_cfgfile");
|
||||
exec("sed -ri 's/_(BR0|BOND0|ETH0)(_[0-9]+)?=/_{$port}\\2=/' $docker_cfgfile");
|
||||
}
|
||||
|
||||
$defaults = @parse_ini_file("$docroot/plugins/dynamix.docker.manager/default.cfg") ?: [];
|
||||
|
||||
Reference in New Issue
Block a user