Last active
August 29, 2015 14:19
-
-
Save djmaze/cb309dbb2fcf277b4223 to your computer and use it in GitHub Desktop.
conftmpl.sh
This file contains hidden or 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
#!/bin/bash | |
FILENAME=$1 | |
for config in */config; do | |
DIR=$(dirname $config) | |
cp $FILENAME.tmpl $DIR/$FILENAME.env | |
VARS=$(sed "s/\n/ /g" $config) | |
env $VARS /home/ubuntu/envconf/envconf $DIR/$FILENAME | |
done |
This file contains hidden or 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
$ find | |
. | |
./user_data.tmpl | |
./coreos2 | |
./coreos2/config | |
./coreos1 | |
./coreos1/config | |
$ cat user_data.tmpl | |
Test $TEST for you! | |
$ cat coreos1/config | |
TEST=1 | |
$ cat coreos2/config | |
TEST=2 | |
$ ~/conftmpl user_data | |
$ find | |
. | |
./user_data.tmpl | |
./coreos2 | |
./coreos2/config | |
./coreos2/user_data | |
./coreos1 | |
./coreos1/config | |
./coreos1/user_data | |
$ cat coreos1/user_data | |
Test 1 for you! | |
$ cat coreos2/user_data | |
Test 2 for you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment