diff options
author | Jordan Wilberding <[email protected]> | 2014-05-10 09:47:29 +0200 |
---|---|---|
committer | Jordan Wilberding <[email protected]> | 2014-05-10 09:47:29 +0200 |
commit | 184f6d067557bdb21334e8e6fb4129711eadab36 (patch) | |
tree | 035463d5c36262c15a8b7c81ac935c19a033eada /priv | |
parent | cce8d751a86cee972d8b9f7efb8bb43a1054d5f5 (diff) | |
parent | ee9afce820d6b202f7d70d714b159e261d566a31 (diff) | |
download | relx-184f6d067557bdb21334e8e6fb4129711eadab36.tar.gz relx-184f6d067557bdb21334e8e6fb4129711eadab36.tar.bz2 relx-184f6d067557bdb21334e8e6fb4129711eadab36.zip |
Merge pull request #180 from tsloughter/awk
add option to extended start script to replace env vars in config files
Diffstat (limited to 'priv')
-rw-r--r-- | priv/templates/extended_bin.dtl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/priv/templates/extended_bin.dtl b/priv/templates/extended_bin.dtl index 807116b..0dcdd18 100644 --- a/priv/templates/extended_bin.dtl +++ b/priv/templates/extended_bin.dtl @@ -65,6 +65,11 @@ if [ -z "$VMARGS_PATH" ]; then fi fi +if [ $RELX_REPLACE_OS_VARS ]; then + awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < $VMARGS_PATH > $VMARGS_PATH.2.config + VMARGS_PATH=$VMARGS_PATH.2.config +fi + # Make sure log directory exists mkdir -p "$RUNNER_LOG_DIR" @@ -76,6 +81,11 @@ if [ -z "$CONFIG_PATH" ]; then fi fi +if [ $RELX_REPLACE_OS_VARS ]; then + awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < $CONFIG_PATH > $CONFIG_PATH.2.config + CONFIG_PATH=$CONFIG_PATH.2.config +fi + # Extract the target node name from node.args NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH") if [ -z "$NAME_ARG" ]; then |