diff --git a/xCAT-server-2.0/sbin/xcatconfig b/xCAT-server-2.0/sbin/xcatconfig index 069bd0aec..eca14e1b4 100644 --- a/xCAT-server-2.0/sbin/xcatconfig +++ b/xCAT-server-2.0/sbin/xcatconfig @@ -372,25 +372,24 @@ if (( ! -r "/etc/xcat/policy.sqlite" ) || $::FORCE) { # set up the certificates for xcatd # if (( ! -d "/etc/xcat/ca" ) || $::FORCE) { - - xCAT::MsgUtils->message('I', "Running $::XCATROOT/share/xcat/scripts/setup-xcat-ca.sh.\n"); - my $cmd = "yes | $::XCATROOT/share/xcat/scripts/setup-xcat-ca.sh 'xCAT CA'"; - my $outref = xCAT::Utils->runcmd("$cmd", 0); - if ($::RUNCMD_RC != 0) + xCAT::MsgUtils->message('I', "\nSetting up basic certificates. Respond with a \'y\' when prompted.\n\n"); + my $cmd = "$::XCATROOT/share/xcat/scripts/setup-xcat-ca.sh 'xCAT CA'"; + xCAT::MsgUtils->message('I', "Running $cmd\n"); + my $rc = system($cmd); + if ($rc >> 8) { xCAT::MsgUtils->message('E', "Could not create xCAT certificate in /etc/xcat/ca.\n"); } else { xCAT::MsgUtils->message('I', "Created xCAT certificate.\n"); } - } if (( ! -d "/etc/xcat/cert" ) || $::FORCE) { - xCAT::MsgUtils->message('I', "Running $::XCATROOT/share/xcat/scripts/setup-server-cert.sh.\n"); - my $cmd = "yes | $::XCATROOT/share/xcat/scripts/setup-server-cert.sh `hostname`"; - my $outref = xCAT::Utils->runcmd("$cmd", 0); - if ($::RUNCMD_RC != 0) + my $cmd = "$::XCATROOT/share/xcat/scripts/setup-server-cert.sh $hname"; + xCAT::MsgUtils->message('I', "Running $cmd\n"); + my $rc = system($cmd); + if ($rc >> 8) { xCAT::MsgUtils->message('E', "Could not create xCAT certificate in /etc/xcat/cert.\n"); } else { @@ -400,10 +399,10 @@ if (( ! -d "/etc/xcat/cert" ) || $::FORCE) { if ( ( ! -r "$::root/.xcat/client-key.pem") || $::FORCE){ - xCAT::MsgUtils->message('I', "Running $::XCATROOT/share/xcat/scripts/setup-local-client.sh.\n"); - my $cmd = "yes | $::XCATROOT/share/xcat/scripts/setup-local-client.sh root"; - my $outref = xCAT::Utils->runcmd("$cmd", 0); - if ($::RUNCMD_RC != 0) + my $cmd = "$::XCATROOT/share/xcat/scripts/setup-local-client.sh root"; + xCAT::MsgUtils->message('I', "Running $cmd\n"); + my $rc = system($cmd); + if ($rc >> 8) { xCAT::MsgUtils->message('E', "Could not create xCAT certificate in /.xcat/client-key.pem.\n"); } else {