Last active
April 18, 2017 14:29
-
-
Save Alexhha/abff3eb967241e03ad36a84ba48029f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ "A" == "A" ]]; then | |
sed -r "s/^(#)?labels=.*/labels=PROJECT:Venice;SERVER-STACK:${APP_NAME}-${ENV};\ | |
EC2-TYPE:${INSTANCE_TYPE};VPC:${VPC_ID}/" newrelic.cfg | grep labels | |
fi | |
if [[ "A" == "A" ]]; then | |
sed -r "s/^(#)?labels=.*/labels=PROJECT:Venice;SERVER-STACK:${APP_NAME}-${ENV};\ | |
EC2-TYPE:${INSTANCE_TYPE};VPC:${VPC_ID}/" newrelic.cfg | grep labels | |
fi | |
SED_REPLACE_EXPR="labels=PROJECT:Venice;SERVER-STACK:${APP_NAME}-${ENV};EC2-TYPE:${INSTANCE_TYPE};VPC:${VPC_ID}" | |
SED_MATCH_EXPR='s/^(#)?labels=.*' | |
if [[ "A" == "A" ]]; then | |
sed -r "${SED_MATCH_EXPR}/${SED_REPLACE_EXPR}/" newrelic.cfg | |
fi | |
SED_REPLACE_EXPR="s/^(#)?labels=.*/labels=PROJECT:Venice;\ | |
SERVER-STACK:${APP_NAME}-${ENV};\ | |
EC2-TYPE:${INSTANCE_TYPE};VPC:${VPC_ID}" | |
sed -r "${SED_REPLACE_EXPR//[$'\t\r\n ']}/" newrelic.cfg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment