#!/usr/bin/perl
#KSOS=OS Type
#KSNAME=HostName
#KSIPADDR=IP Address
#KSSNET=Subnet Address
#KSGW=Gateway
#set -x
sub printget {
print shift;;
my $in=;
chomp $in;
return $in;
}
my $KSNAME=printget("Server Name: ");
my $KSIPADDR = printget("Server IP Address: ");
my $KSSNET=printget("Subnet Mask: ");
my $KSGW=printget("Default Gateway: ");
my $KSOS = printget("Target OS: [332|432|464] ");
my $KSDITRIB = printget("Dristribution [AS|ES] ");
system("cp --reply=yes /ISO/ks/$KSOS.ks /ISO/BOOTCD/$KSOS/ks.cfg");
system("cp --reply=yes /axa-lci/serverconfigs/US/$KSOS.conf /axa-lci/serverconfigs/US/$KSNAME.conf");
open(KSNAME, ">./$KSNAME.sh") or die "Could not open ./$KSNAME.sh: $!\n";
print KSNAME "sed -i 's/NNAME/$KSNAME/g' /ISO/BOOTCD/$KSOS/ks.cfg";
print KSNAME "sed -i 's/NNAME/$KSNAME/g' /axa-lci/serverconfigs/US/$KSNAME.conf";
print KSNAME "sed -i 's/NDISTRIB/$KSDITRIB/g' /axa-lci/serverconfigs/US/$KSNAME.conf";
print KSNAME "sed -i 's/NIPADDR/$KSIPADDR/g' /ISO/BOOTCD/$KSOS/ks.cfg";
print KSNAME "sed -i 's/NIPADDR/$KSIPADDR/g' /axa-lci/serverconfigs/US/$KSNAME.conf";
print KSNAME "sed -i 's/NSNET/$KSSNET/g' /ISO/BOOTCD/$KSOS/ks.cfg";
print KSNAME "sed -i 's/NGW/$KSGW/g' /ISO/BOOTCD/$KSOS/ks.cfg";
print KSNAME "mkisofs -o /ISO/BOOTCD/$KSNAME.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /ISO/BOOTCD/$KSOS";
system("/bin/bash ./$KSNAME.sh");
unlink("./$KSNAME.sh") or die "Could not remove $KSNAME.sh: $!\n";
|