From 5e7008e55dfb89260dc6e871f627be4dca82e4d5 Mon Sep 17 00:00:00 2001 From: nott Date: Tue, 10 Mar 2009 19:53:36 +0000 Subject: [PATCH] Misc updates & cleanup git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2871 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcataixpost | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/xCAT/postscripts/xcataixpost b/xCAT/postscripts/xcataixpost index 2910d0da8..fce8d91a4 100755 --- a/xCAT/postscripts/xcataixpost +++ b/xCAT/postscripts/xcataixpost @@ -57,8 +57,6 @@ if (-f "/etc/xcatinfo") { } else { print "$::sdate xcataixpost: Could not find /etc/niminfo file.\n"; print $::LOG_FILE "$::sdate xcataixpost: Could not find /etc/niminfo file.\n"; - close($::LOG_FILE); - exit 1; } } $servnode =~ s/^\s*//; @@ -69,8 +67,6 @@ my $cmd = "mkdir -p /xcatpost"; if (&runcmd($cmd) != 0) { print "$::sdate xcataixpost: Could not make the /xcatpost directory.\n"; print $::LOG_FILE "$::sdate xcataixpost: Could not make the /xcatpost directory.\n"; - close($::LOG_FILE); - exit 1; } # get the contents of the /install/postscripts dir on the server @@ -79,31 +75,26 @@ my $mcmd = "mkdir -p /xcatmnt; mount $servnode:/install/postscripts /xcatmnt"; if (&runcmd($mcmd) != 0) { print "$::sdate xcataixpost: Could not mount /install/postscripts from $servnode.\n"; print $::LOG_FILE "$::sdate xcataixpost: Could not mount /install/postscripts from $servnode.\n"; - close($::LOG_FILE); - exit 1; } +my $cpcmd; if ((@ARGV==0) || ($ARGV[0] != 2)) { - my $cpcmd = "cp -r /xcatmnt /xcatpost >/dev/null 2>&1"; + $cpcmd = "cp -r /xcatmnt/* /xcatpost 2>/dev/null"; } else { # when argv[1]=2, there is only one postscript file, # user wants only download it to save time - $cpcmd= "cp /xcatmnt/postscripts/$ARGV[1] /xcatpost >/dev/null 2>&1"; + $cpcmd= "cp /xcatmnt/$ARGV[1] /xcatpost >/dev/null 2>&1"; } if (&runcmd($cpcmd) != 0) { - print "$::sdate xcataixpost: Could not copy postscripts to /xcatpost.\n"; - print $::LOG_FILE "$::sdate xcataixpost: Could not copy postscripts to /xcatpost.\n"; - close($::LOG_FILE); - exit 1; +# print "$::sdate xcataixpost: Could not copy postscripts to /xcatpost.\n"; +# print $::LOG_FILE "$::sdate xcataixpost: Could not copy postscripts to /xcatpost.\n"; } my $ucmd = "umount /xcatmnt; rmdir /xcatmnt"; if (&runcmd($ucmd) != 0) { print "$::sdate xcataixpost: Could not unmount /install.\n"; print $::LOG_FILE "$::sdate xcataixpost: Could not unmount /install/postscripts.\n"; - close($::LOG_FILE); - exit 1; } # request the xCAT postscript for this particular node @@ -111,8 +102,6 @@ $scriptname = "/xcatpost/myxcatpost_" . $::shorthost; if (&getmypost != 0) { print "$::sdate xcataixpost: Could not get the xCAT post script for this node.\n"; print $::LOG_FILE "$::sdate xcataixpost: Could not get the xCAT post script for this node.\n"; - close($::LOG_FILE); - exit 1; } # make sure all are executable @@ -120,8 +109,6 @@ my $chcmd = "chmod +x /xcatpost/*"; if (&runcmd($chcmd) != 0) { print "$::sdate xcataixpost: Could not change /xcatpost file permissions.\n"; print $::LOG_FILE "$::sdate xcataixpost: Could not change /xcatpost file permissions.\n"; - close($::LOG_FILE); - exit 1; } # check & run the postscript