diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu b/xCAT-server/share/xcat/install/scripts/post.ubuntu index 935ea4be3..01b35b9e4 100755 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu @@ -159,8 +159,12 @@ run_ps () { echo \"\`date\` Running postscript: \$*\" msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$*\"" \"\$logfile\" if [ \"\$XCATDEBUGMODE\" = \"1\" ]; then - bash -x ./\$@ 2>&1 | tee -a \$logfile - ret_local=\${PIPESTATUS[0]} + local compt=\$(file \$1) + local reg=\"shell script\" + if [[ \"\$compt\" =~ \$reg ]]; then + bash -x ./\$@ 2>&1 | tee -a \$logfile + ret_local=\${PIPESTATUS[0]} + fi else ./\$@ 2>&1 | tee -a \$logfile ret_local=\${PIPESTATUS[0]} diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat b/xCAT-server/share/xcat/install/scripts/post.xcat index 85632056e..7c1719200 100755 --- a/xCAT-server/share/xcat/install/scripts/post.xcat +++ b/xCAT-server/share/xcat/install/scripts/post.xcat @@ -144,8 +144,12 @@ run_ps () { echo \"\`date\` Running postscript: \$*\" msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$*\"" \"\$logfile\" if [ \"\$XCATDEBUGMODE\" = \"1\" ]; then - bash -x ./\$@ 2>&1 | tee -a \$logfile - ret_local=\${PIPESTATUS[0]} + local compt=\$(file \$1) + local reg=\"shell script\" + if [[ \"\$compt\" =~ \$reg ]]; then + bash -x ./\$@ 2>&1 | tee -a \$logfile + ret_local=\${PIPESTATUS[0]} + fi else ./\$@ 2>&1 | tee -a \$logfile ret_local=\${PIPESTATUS[0]} diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 646ef18e3..cf86c2e03 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -829,8 +829,12 @@ run_ps () { echo \"\`date\` Running postscript: \$*\" msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$*\"" \"\$logfile\" if [ \"\$XCATDEBUGMODE\" = \"1\" ]; then - bash -x ./\$@ 2>&1 | tee -a \$logfile - ret_local=\${PIPESTATUS[0]} + local compt=\$(file \$1) + local reg=\"shell script\" + if [[ \"\$compt\" =~ \$reg ]]; then + bash -x ./\$@ 2>&1 | tee -a \$logfile + ret_local=\${PIPESTATUS[0]} + fi else ./\$@ 2>&1 | tee -a \$logfile ret_local=\${PIPESTATUS[0]}