replaceAutoconfig.sh 1 KB
#!/bin/bash

#AUTOCONFIG_PATH=/home/test/deploy2/auto_deploy_test/autoconfig/test_nj_4/config4deploy2
AUTOCONFIG_PATH=/home/test/auto_deploy/deploy/autoconfig/test_performance

for file in $AUTOCONFIG_PATH/*.properties
do
SYS_NAME=$(echo $file | awk -F "${AUTOCONFIG_PATH}/" '{print $2}' | awk -F '-autoconfig' '{print $1}')

sed -i "s/autoconfig.properties.sharedAutoconfig  = file:.*/autoconfig.properties.sharedAutoconfig  = file:\/home\/test\/auto_deploy_test\/autoconfig\/test_performance\/global-autoconfig.properties/g" $file

sed -i "s/.env.webapphome  = \/home\/test.*/.env.webapphome  = \/home\/test\/yohoJavaApp\/${SYS_NAME}\/deploy\/target/g" $file
sed -i "s/.env.webapphome   = \/home\/test.*/.env.webapphome  = \/home\/test\/yohoJavaApp\/${SYS_NAME}\/deploy\/target/g" $file

echo "$SYS_NAME  done!"
done

echo "ALL DONE"
echo "不包含deploy2的............"

cd $AUTOCONFIG_PATH
find ./ -name "*.properties" | xargs grep -e "autoconfig.properties.sharedAutoconfig" -e ".env.webapphome" | grep -v yohoJavaApp