Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (18 sloc) 502 Bytes
#!/bin/bash -e
SERVICE_DIR=$(dirname $0)/service
PORT=$1
HAPROXY_PORT=$2
if [ -z "$PORT" ]; then
echo "usage: $0 port_number haproxy_port" >&2
exit 2
fi
NEW_SERVICE_DIR="$SERVICE_DIR/nginx-$PORT-$HAPROXY_PORT"
if [ ! -e "$NEW_SERVICE_DIR" ]; then
mkdir -p "$NEW_SERVICE_DIR"
ln -s ../../nginx-run $NEW_SERVICE_DIR/run
ln -s ../../check-port $NEW_SERVICE_DIR/check
echo "created nginx service $NEW_SERVICE_DIR"
else
echo "nginx service $NEW_SERVICE_DIR already exists" >&2
exit 1
fi