Skip to content

Instantly share code, notes, and snippets.

@dlip
Created April 22, 2014 07:57
Show Gist options
  • Save dlip/11169293 to your computer and use it in GitHub Desktop.
Save dlip/11169293 to your computer and use it in GitHub Desktop.
Simple bash templating for nginx and docker
#!/bin/bash
REGISTRY_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' registry)
for f in *
do
if [[ "$f" != *\.sh ]]
then
config=$(<$f);
config=${config//REGISTRY_IP/$REGISTRY_IP};
printf '%s\n' "$config" >../sites-enabled/$f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment