/[vz-tools]/trunk/vz-clone.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-clone.pl

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

revision 33 by dpavlin, Tue Oct 16 09:35:59 2007 UTC revision 50 by dpavlin, Thu Aug 14 22:49:05 2008 UTC
# Line 169  exit if $action eq 'mount'; Line 169  exit if $action eq 'mount';
169    
170  my $note = "# modified by $0\n";  my $note = "# modified by $0\n";
171    
172    my $ve_clone_ip;
173    
174  sub fix_ip {  sub fix_ip {
175          my $ip = shift;          my $ip = shift;
176          $ip =~ s/['"]//g;          $ip =~ s/['"]//g;
177  #       $ip =~ s/^\d+\./10./;  #       $ip =~ s/^\d+\./10./;
178          $ip =~ s/^\d+\.\d+\./192.168./;          $ip =~ s/^\d+\.\d+\./192.168./;
179          warn "$CVEID new IP number: $ip\n";          warn "$CVEID new IP number: $ip\n";
180            $ve_clone_ip = $ip;
181          return $note . qq{IP_ADDRESS="$ip"};          return $note . qq{IP_ADDRESS="$ip"};
182  }  }
183    
# Line 195  while(<$o>) { Line 198  while(<$o>) {
198          print $n $_;          print $n $_;
199  }  }
200    
201  print "\nPlease review config file: $conf/$CVEID.conf\nAdd NAT for new VE with: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nStart clone of $VEID with: vzctl start $CVEID\n"  print "\nPlease review config file: $conf/$CVEID.conf\nAdd NAT for new VE with: iptables -t nat -A POSTROUTING -s $ve_clone_ip -o eth0 -j MASQUERADE\nStart clone of $VEID with: vzctl start $CVEID\n"

Legend:
Removed from v.33  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26