replace slashes with dashes for hostname

This commit is contained in:
Jeff Lindsay
2013-06-10 19:53:34 -07:00
parent 5a883042eb
commit 06f2c8ff5e

View File

@@ -8,8 +8,8 @@ if [[ ! -f "$HOME/$APP/PORT" ]]; then
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
echo $PORT > "$HOME/$APP/PORT"
if [[ -f "$HOME/DOMAIN" ]]; then
HOSTNAME="$APP.$(< "$HOME/DOMAIN")"
$HOME/nginx-app-conf $APP $PORT $HOSTNAME > $HOME/$APP/nginx.conf
HOSTNAME="${APP/\//-}.$(< "$HOME/DOMAIN")"
$HOME/nginx-app-conf ${APP/\//-} $PORT $HOSTNAME > $HOME/$APP/nginx.conf
nc -U $HOME/reload-nginx
else
HOSTNAME="$(< "$HOME/HOSTNAME"):$PORT"