From 2ca089af3af446df2645e8836657b39f4c188509 Mon Sep 17 00:00:00 2001 From: wuzhy Date: Mon, 12 Apr 2010 09:22:55 +0000 Subject: [PATCH] adjust the log code for run_ps git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5740 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcataixpost | 8 +++----- xCAT/postscripts/xcatdsklspost | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/xCAT/postscripts/xcataixpost b/xCAT/postscripts/xcataixpost index 7cb5876c0..4198ea7c8 100755 --- a/xCAT/postscripts/xcataixpost +++ b/xCAT/postscripts/xcataixpost @@ -264,15 +264,13 @@ run_ps () { logfile=\\"/var/log/xcat/xcat.log\\" if [[ -f \\\$1 ]]; then - echo \\"Running postscript: \\\$1\\" + echo \\"Running postscript: \\\$1\\" | tee -a \\\$logfile OUTPUT=\\\`./\\\$1 2>&1\\\` if [[ -n \\\$OUTPUT ]]; then - echo \\"\\\$OUTPUT\\" - echo \\"Postscript \\\$1: \\\$OUTPUT\\" >> \\\$logfile + echo \\"\\\$OUTPUT\\" | tee -a \\\$logfile fi else - echo \\"Postscript \\\$1 does NOT exist.\\" - echo \\"Postscript \\\$1 does NOT exist.\\" >> \\\$logfile + echo \\"Postscript \\\$1 does NOT exist.\\" | tee -a \\\$logfile fi } # subroutine end diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 817b574a5..b32782099 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -314,15 +314,13 @@ run_ps () { logfile=\"var/log/xcat/xcat.log\" if [[ -f \$1 ]]; then - echo \"Running postscript: \$1\" + echo \"Running postscript: \$1\" | tee -a \$logfile OUTPUT=\`./\$1 2>&1\` if [[ -n \$OUTPUT ]]; then - echo \"\$OUTPUT\" - echo \"Postscript \$1: $OUTPUT\"\ >> \$logfile + echo \"\$OUTPUT\" | tee -a \$logfile fi else - echo \"Postscript \$1 does NOT exist.\" - echo \"Postscript \$1 does NOT exist.\" >> \$logfile + echo \"Postscript \$1 does NOT exist.\" | tee -a \$logfile fi } # subroutine end