Skip to content

Commit

Permalink
Allow registering monitor with IPv6 address
Browse files Browse the repository at this point in the history
  • Loading branch information
abh committed Jun 8, 2011
1 parent 840cdce commit 2e7a81e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pool
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ elsif ($cmd eq "addmonitor") {
my $user = find_user_by_email($email); my $user = find_user_by_email($email);


# do we have a hostname or an IP? # do we have a hostname or an IP?
my $ip; my $ip = Net::IP->new($hostname);
if (Net::IP::ip_is_ipv4($hostname)) {
$ip = $hostname; if ($ip) {
$ip = $ip->short;
$hostname = undef; $hostname = undef;
} }
else { else {
Expand Down

0 comments on commit 2e7a81e

Please sign in to comment.