nixos-container: fix show-ip command to support IPv6 addresses

This commit is contained in:
Vojtěch Káně 2021-02-01 09:38:34 +01:00
parent 4695a7ca51
commit 5e9811b552

View file

@ -458,7 +458,7 @@ 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-9a-zA-Z:]+))(\/[0-9]+)?$/m or die "$0: cannot get IP address\n";
print "$1\n";
}