diff options
author | Tristan Sloughter <[email protected]> | 2014-05-09 20:03:25 -0500 |
---|---|---|
committer | Tristan Sloughter <[email protected]> | 2014-05-09 20:10:48 -0500 |
commit | ee9afce820d6b202f7d70d714b159e261d566a31 (patch) | |
tree | 140d633e02f8092df74b36625e813bd2e5c98855 /priv | |
parent | 4c50cb6ab933cd08f51763f9a62436271d9962f5 (diff) | |
download | relx-ee9afce820d6b202f7d70d714b159e261d566a31.tar.gz relx-ee9afce820d6b202f7d70d714b159e261d566a31.tar.bz2 relx-ee9afce820d6b202f7d70d714b159e261d566a31.zip |
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 |