20 |
|
|
21 |
print "Creating new OpenVZ instance...\n"; |
print "Creating new OpenVZ instance...\n"; |
22 |
|
|
23 |
my $arg = shift @ARGV; |
my $arg = shift @ARGV || ''; |
24 |
|
|
25 |
my ($hostname, $ip); |
my ($hostname, $ip) = ('localhost',''); |
26 |
|
|
27 |
if ($arg =~ m/$RE{net}{IPv4}/) { |
if ($arg =~ m/$RE{net}{IPv4}/) { |
28 |
$ip = $arg; |
$ip = $arg; |
29 |
chomp($hostname); |
chomp($hostname); |
30 |
$hostname = host($arg); |
$hostname = host($arg); |
31 |
$hostname =~ s/^.*\s(\S+)$/$1/; |
$hostname =~ s/^.*\s(\S+)$/$1/; |
32 |
} else { |
} elsif ($arg) { |
33 |
$hostname = $arg; |
$hostname = $arg; |
34 |
$ip = host($arg); |
$ip = host($arg); |
35 |
chomp($ip); |
chomp($ip); |