#!/usr/bin/env perl

$ENV{TERM} = "xterm-256color";

my $os   = $ARGV[0];
my $arch = $ARGV[1];
my $log  = "/tmp/change_site_table_values.log";

sub runcmd {
    my $cmd = shift;
    `$cmd >> $log 2>&1`;
    if ($?) {
        
        exit 1;
    }
}

my $blademaxp_value=6400;
my $domain_value="testdomain";
my $fsptimeout_value=100;
my $installdir_value="installdirtest";
my $ipmimaxp_value=6400;
my $ipmiretries_value=300;
my $ipmitimeout_value=200;    
my $consoleondemand_value="notest";
my $master_value="mastertest";
my $forwarders_value="forwarderstest";
my $nameservers_value="mastertest";
my $maxssh_value=800;
my $ppcmaxp_value=6400;
my $ppcretry_value=300;
my $ppctimeout_value=100;
my $powerinterval_value=100;
my $syspowerinterval_value=100;
my $sharedtftp_value=100;
my $SNsyncfiledir_value="syncdirtest";       
my $nodesyncfiledir_value="nodesyncdirtest";
my $tftpdir_value="tftpdirtest";     
my $xcatdport_value="xcatporttest";
my $xcatiport_value="xcatiporttest";     
my $xcatconfdir_value="confdirtest";
my $timezone_value="test";
my $useNmapfromMN_value="notest";
my $enableASMI_value="notest";
my $db2installloc_value="\/mntdb2test";
my $databaseloc_value="\/var\/libtest";
my $sshbetweennodes_value="ALLGROUPStest";
my $dnshandler_value="ddnstest";
my $vsftp_value="ntest";
my $cleanupxcatpost_value="notest";
my $dhcplease_value=43200;
my $auditnosyslog_value=100;
my $xcatsslversion_value="tLSv1test";
my $auditskipcmds_value="ALLtest";


$cmd = "chtab key=domain site.value=$domain_value";
runcmd("$cmd");
$cmd = "chtab key=fsptimeout site.value=$fsptimeout_value";
runcmd("$cmd");
$cmd = "chtab key=installdir site.value=$installdir_value";
runcmd("$cmd");
$cmd = "chtab key=ipmimaxp site.value=$ipmimaxp_value";
runcmd("$cmd");
$cmd = "chtab key=ipmiretries site.value=$ipmiretries_value";
runcmd("$cmd");
$cmd = "chtab key=ipmitimeout site.value=$ipmitimeout_value";
runcmd("$cmd");
$cmd = "chtab key=consoleondemand site.value=$consoleondemand_value";
runcmd("$cmd");
$cmd = "chtab key=master site.value=$master_value";
runcmd("$cmd");
$cmd = "chtab key=forwarders site.value=$forwarders_value";
runcmd("$cmd");
$cmd = "chtab key=nameservers site.value=$nameservers_value";
runcmd("$cmd");
$cmd = "chtab key=maxssh site.value=$maxssh_value";
runcmd("$cmd");
$cmd = "chtab key=ppcmaxp site.value=$ppcmaxp_value";
runcmd("$cmd");
$cmd = "chtab key=ppcretry site.value=$ppcretry_value";
runcmd("$cmd");
$cmd = "chtab key=ppctimeout site.value=$ppctimeout_value";
runcmd("$cmd");
$cmd = "chtab key=powerinterval site.value=$powerinterval_value";
runcmd("$cmd");
$cmd = "chtab key=syspowerinterval site.value=$syspowerinterval_value";
runcmd("$cmd");
$cmd = "chtab key=sharedtftp site.value=$sharedtftp_value";
runcmd("$cmd");
$cmd = "chtab key=SNsyncfiledir site.value=$SNsyncfiledir_value";
runcmd("$cmd");
$cmd = "chtab key=nodesyncfiledir site.value=$nodesyncfiledir_value";
runcmd("$cmd");
$cmd = "chtab key=tftpdir site.value=$tftpdir_value";
runcmd("$cmd");
$cmd = "chtab key=xcatdport site.value=$xcatdport_value";
runcmd("$cmd");
$cmd = "chtab key=xcatiport site.value=$xcatiport_value";
runcmd("$cmd");
$cmd = "chtab key=xcatconfdir site.value=$xcatconfdir_value";
runcmd("$cmd");
$cmd = "chtab key=timezone site.value=$timezone_value";
runcmd("$cmd");
$cmd = "chtab key=useNmapfromMN site.value=$useNmapfromMN_value";
runcmd("$cmd");
$cmd = "chtab key=enableASMI site.value=$enableASMI_value";
runcmd("$cmd");
$cmd = "chtab key=db2installloc site.value=$db2installloc_value";
runcmd("$cmd");
$cmd = "chtab key=databaseloc site.value=$databaseloc_value";
runcmd("$cmd");
$cmd = "chtab key=sshbetweennodes site.value=$sshbetweennodes_value";
runcmd("$cmd");
$cmd = "chtab key=dnshandler site.value=$dnshandler_value";
runcmd("$cmd");
$cmd = "chtab key=vsftp site.value=$vsftp_value";
runcmd("$cmd");
$cmd = "chtab key=cleanupxcatpost site.value=$cleanupxcatpost_value";
runcmd("$cmd");
$cmd = "chtab key=dhcplease site.value=$dhcplease_value";
runcmd("$cmd");
$cmd = "chtab key=auditnosyslog site.value=$auditnosyslog_value";
runcmd("$cmd");
$cmd = "chtab key=xcatsslversion site.value=$xcatsslversion_value";
runcmd("$cmd");
$cmd = "chtab key=auditskipcmds site.value=$auditskipcmds_value";
runcmd("$cmd");

exit 0;

