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:
Maximilian Bosch 2021-03-05 18:27:38 +01:00 committed by GitHub
commit 71770e1f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -458,7 +458,9 @@ elsif ($action eq "run") {
elsif ($action eq "show-ip") {
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";
}