#!/usr/bin/perl

@CONF=<STDIN>;

for ($kk=150; $kk<200; $kk++){
  
foreach $i (@CONF){
  $ret="";
  if ($i =~ /uuid/){
      open(UUID, "uuidgen|");
      $uuid = <UUID>;
      close(UUID);
      chomp($uuid);
      $ret .= "uuid = \"$uuid\"\n";
  }elsif ($i =~ /name/){
      $ret .= "name =\"fv5x_$kk\"\n";  
  }else{
      $ret .= $i;
  }
  print $ret;

  open(OUT, ">/etc/xen/fv5x_$kk");
  print OUT $ret;
  close(OUT);
}

}
