2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

check the postscripts before running it with 'bash -x'

This commit is contained in:
penguhyang 2015-09-28 23:08:55 -04:00
parent d17059a8b8
commit 28533f9411
3 changed files with 18 additions and 6 deletions

View File

@ -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]}

View File

@ -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]}

View File

@ -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]}