# Configuration section is below. Ignore this part

function isUbuntu {
  if [ -f /etc/lsb-release ]; then
    grep -i ubuntu /etc/lsb-release | head -n 1 | cut -d \  -f 1 | cut -d = -f 2
  fi
}

function isRedHat {
  if [ -d "/etc/rc.d/init.d" ]; then echo yes; fi
}

function isMac {
  if [[ "$(uname -a | cut -d \  -f 1 )" == "Darwin" ]]; then echo yes; fi
}

# 
# Configuration section start
#

# Bind host
GITBUCKET_HOST=0.0.0.0

# Other Java option
GITBUCKET_JVM_OPTS=-Dmail.smtp.starttls.enable=true

# Data directory, holds repositories
GITBUCKET_HOME=/var/lib/gitbucket

GITBUCKET_LOG_DIR=/var/log/gitbucket

# Server port
GITBUCKET_PORT=8080

# URL prefix for the GitBucket page (http://<host>:<port>/<prefix>/)
GITBUCKET_PREFIX=

# Directory where GitBucket is installed
# Configuration is stored here:
GITBUCKET_DIR=/usr/share/gitbucket
GITBUCKET_WAR_DIR=$GITBUCKET_DIR/lib

# Path to the WAR file
GITBUCKET_WAR_FILE=$GITBUCKET_WAR_DIR/gitbucket.war

# GitBucket version to fetch when installing
GITBUCKET_VERSION=3.5

#
# End of configuration section. Ignore this part
#
if [ `isUbuntu` ]; then
  GITBUCKET_SERVICE=/etc/init.d/gitbucket
elif [ `isRedHat` ]; then
  GITBUCKET_SERVICE=/etc/rc.d/init.d
elif [ `isMac` ]; then
  GITBUCKET_SERVICE=/Library/StartupItems/GitBucket/GitBucket
else
  echo "Don't know how to install onto this OS"
  exit -2
fi

