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:
commit
c48d5a1a94
@ -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]}
|
||||
|
@ -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]}
|
||||
|
@ -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]}
|
||||
|
Loading…
x
Reference in New Issue
Block a user