Allow prompting from certificate setup scripts.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@327 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2008-01-25 17:40:04 +00:00
parent c1b03f38fd
commit bb240e7708

View File

@ -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 {