Merge pull request #111530 from vojta001/nixos-container-show-ip-ipv6
nixos-container: fix show-ip command to support IPv6 addresses
This commit is contained in:
commit
71770e1f6f
@ -458,7 +458,9 @@ elsif ($action eq "run") {
|
|||||||
|
|
||||||
elsif ($action eq "show-ip") {
|
elsif ($action eq "show-ip") {
|
||||||
my $s = read_file($confFile) or die;
|
my $s = read_file($confFile) or die;
|
||||||
$s =~ /^LOCAL_ADDRESS=([0-9\.]+)(\/[0-9]+)?$/m or die "$0: cannot get IP address\n";
|
$s =~ /^LOCAL_ADDRESS=([0-9\.]+)(\/[0-9]+)?$/m
|
||||||
|
or $s =~ /^LOCAL_ADDRESS6=([0-9a-f:]+)(\/[0-9]+)?$/m
|
||||||
|
or die "$0: cannot get IP address\n";
|
||||||
print "$1\n";
|
print "$1\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user