/[vz-tools]/trunk/vz-create.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/vz-create.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9 by dpavlin, Sun Jan 7 15:21:36 2007 UTC revision 10 by dpavlin, Sun Jan 7 23:25:19 2007 UTC
# Line 20  my $diskspace = '2G:4G'; Line 20  my $diskspace = '2G:4G';
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);

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26