Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 25 lines (20 sloc) 0.541 kb
#! /bin/sh
#
# gen_dev dev4 vars.src vars
#
# Generate an overlay config for devNNN from vars.src and write to vars
#
NAME=$1
TEMPLATE=$2
VARFILE=$3
## Allocate 10 ports per node
## .7 - http
NUMBER=${NAME##dev}
BASE=$((10000 + 10 * $NUMBER))
WEBPORT=$(($BASE + 8))
HANDOFFPORT=$(($BASE + 9))
NODENAME="{{appid}}$NUMBER@127.0.0.1"
echo "Generating $NAME - node='$NODENAME' http=$WEBPORT handoff=$HANDOFFPORT"
sed -e "s/@NODE@/$NODENAME/" \
-e "s/@WEBPORT@/$WEBPORT/" \
-e "s/@HANDOFFPORT@/$HANDOFFPORT/" < $TEMPLATE > $VARFILE
Jump to Line
Something went wrong with that request. Please try again.