#!/bin/bash

if [ "x$WILDFLY_HOME" = "x" ]; then
    WILDFLY_HOME="/var/lib/wildfly"
fi

if [[ "$1" == "domain" ]]; then
    $WILDFLY_HOME/bin/domain.sh -c $2 -b $3 -Djboss.socket.binding.port-offset=$4 -bmanagement=$5 --domain-config=$6 --host-config=$7 -Djboss.domain.log.dir=/var/log/wildfly/domain
else
    $WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -Djboss.socket.binding.port-offset=$4 -bmanagement=$5 -Djboss.domain.log.dir=/var/log/wildfly/standalone
fi
