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 |
|
|
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" |