fix docker

This commit is contained in:
André Bauer 2016-12-06 15:51:33 +01:00
parent e524a82aeb
commit 1be5a72dfe
2 changed files with 19 additions and 0 deletions

View file

@ -21,6 +21,18 @@ function detect_os () {
fi
}
function detect_docker() {
if [ -n "$(grep docker < /proc/1/cgroup)" ]; then
DOCKER="yes"
else
DOCKER="no"
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
echo "os runs in docker container = ${DOCKER}"
fi
}
function detect_initcmd () {
if [ -n "$(which systemctl 2> /dev/null)" ]; then
INIT_CMD="systemctl"
@ -33,11 +45,16 @@ function detect_initcmd () {
INIT_CMD="sysvinit"
fi
if [ "${DOCKER}" == "yes" ]; then
INIT_CMD="initctl"
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
echo "INIT CMD = ${INIT_CMD}"
fi
}
function detect_database () {
if [ -n "$(which psql 2> /dev/null)" ]; then
ADAPTER="postgresql"

View file

@ -15,6 +15,8 @@ set -e
detect_os
detect_docker
detect_initcmd
detect_database