1、更换测试环境日志输出

#!/bin/bash

echo '=================压测环境======================'

#arr=(urcs-as-sbc B "C" D)
arr=('urcs-as-sbc' 'urcs-as-cscf' 'urcs-as-im' 'urcs-as-group' 'urcs-as-dm' 'urcs-as-maap' 'urcs-as-nfs' 'urcs-as-tas' )
for element in ${arr[*]}
do

        exist=`docker inspect --format '{{.State.Running}}' $element`
        if [ "${exist}" == "true" ];then
                echo $element
                docker cp $element:/home/$element/logging.xml ./
                mv logging.xml $element.xml
                sed -i s/INFO/ERROR/g $element.xml
                sed -i s/DEBUG/ERROR/g $element.xml
                mv $element.xml logging.xml
                docker cp logging.xml $element:/home/$element/
                rm -rf logging.xml
        fi

done

 

你可能感兴趣的:(shell)