/[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 58 by dpavlin, Mon Feb 2 12:35:22 2009 UTC revision 77 by dpavlin, Mon Apr 27 12:08:07 2009 UTC
# Line 73  $hostname ||= prompt('Enter hostname: ') Line 73  $hostname ||= prompt('Enter hostname: ')
73    
74  my @ip_split = split(/\./,$ip);  my @ip_split = split(/\./,$ip);
75    
76  my $ve_id = sprintf('%d%03d', $ip_split[2], $ip_split[3]);  # 192.168.42.1  -> 42 001
77    # 10.60.0.3     -> 60 003
78    # 10.60.1.42    ->  1 042
79    
80    my $ve_id = sprintf('%d%03d', $ip_split[2] || $ip_split[1], $ip_split[3]);
81    
82  if ( $ve_id < 101 ) {  if ( $ve_id < 101 ) {
83          $ve_id += 100;          $ve_id += 100;
# Line 149  if ($login) { Line 153  if ($login) {
153          vzctl('set', $ve_id, '--userpasswd', "$login:$passwd" );          vzctl('set', $ve_id, '--userpasswd', "$login:$passwd" );
154  }  }
155    
156  runscript( $ve_id, 'custom/50-hypertable.sh' );  #runscript( $ve_id, 'custom/50-hypertable.sh' );
157  print "OK: $ve_id created\n";  print "OK: $ve_id created\n";

Legend:
Removed from v.58  
changed lines
  Added in v.77

  ViewVC Help
Powered by ViewVC 1.1.26