2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Merge pull request #228 from penguhyang/type_postscript

check the postscripts before running it with 'bash -x'
This commit is contained in:
yangsong 2015-10-19 16:23:15 +08:00
commit c48d5a1a94
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]}