2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 12:20:40 +00:00

turn off logging every single line of a shell script

This commit is contained in:
penguhyang
2016-03-23 04:24:35 -04:00
parent 7cc2045e6e
commit 5f9562f33e
4 changed files with 30 additions and 3 deletions

View File

@ -2,9 +2,12 @@
<script>
<filename>boot.sh</filename>
<interpreter>shell</interpreter>
<debug config:type="boolean">false</debug>
<source>
<![CDATA[
#!/bin/sh
mkdir -p /mnt/var/log/xcat/
{
@ -12,7 +15,10 @@ cat /tmp/pre-install.log >> /mnt/var/log/xcat/xcat.log
echo "Running AutoYaST Chroot-Installation script..."
#!/bin/sh
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set -x
fi
AWK=`find / -name awk | head -1`
#old awk /mounts/instsys/bin/awk -f
@ -76,6 +82,10 @@ elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-F
export PRINIC=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://`
fi
echo 'export PRINIC='"$PRINIC" > /mnt/tmp/prinicsetting
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set +x
fi
} >>/mnt/var/log/xcat/xcat.log 2>&1
]]>

View File

@ -1,10 +1,13 @@
#!/bin/sh
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set -x
fi
export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE#
cd /etc/sysconfig/network
@ -63,3 +66,6 @@ if [ "$XCATDEBUGMODE" != "0" ]; then
fi
/sbin/portmap
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set +x
fi

View File

@ -2,6 +2,7 @@
<script>
<filename>xcat.sh</filename>
<interpreter>shell</interpreter>
<debug config:type="boolean">false</debug>
<source>
<![CDATA[

View File

@ -2,13 +2,19 @@
<script>
<filename>foo.sh</filename>
<interpreter>shell</interpreter>
<debug config:type="boolean">false</debug>
<source>
<![CDATA[
#!/bin/sh
{
echo "Running AutoYaST Pre-Installation script..."
#!/bin/sh
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set -x
fi
AWK=`find / -name awk | tail -1`
#old awk /mounts/instsys/bin/awk -f
@ -163,6 +169,10 @@ fi
export nextserver=`cat /proc/cmdline | grep http | awk -F'autoyast=http://' {'print \$2'} | awk -F':' {'print \$1'}`
cp /tmp/profile/modified.xml /tmp/profile/modified1.xml
sed -e 's!<software>!<add-on><add_on_products config:type="list">#INSTALL_SOURCES_IN_PRE#</add_on_products></add-on><software>!' /tmp/profile/modified1.xml > /tmp/profile/modified.xml
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set +x
fi
} >>/tmp/pre-install.log 2>&1
]]>