added debug mode to postinstall.sh

This commit is contained in:
André Bauer 2016-12-06 19:12:19 +01:00
parent f65b421042
commit 8bda5068ae
3 changed files with 15 additions and 8 deletions

View file

@ -10,4 +10,4 @@ MY_CNF="/etc/mysql/debian.cnf"
ZAMMAD_WEBS="1"
ZAMMAD_WEBSOCKETS="1"
ZAMMAD_WORKERS="1"
DEBUG_OUTPUT="no"
DEBUG="no"

View file

@ -3,6 +3,13 @@
# packager.io postinstall script functions
#
function debug() {
if [ "${DEBUG}" == "yes" ]; then
echo "DEBUG MODE ON"
set -e
fi
}
function detect_os () {
. /etc/os-release
@ -16,7 +23,7 @@ function detect_os () {
OS="UNKNOWN"
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
if [ "${DEBUG}" == "yes" ]; then
echo "OS is ${OS} based"
fi
}
@ -28,7 +35,7 @@ function detect_docker() {
DOCKER="no"
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
if [ "${DEBUG}" == "yes" ]; then
echo "os runs in docker container = ${DOCKER}"
fi
}
@ -49,7 +56,7 @@ function detect_initcmd () {
INIT_CMD="initctl"
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
if [ "${DEBUG}" == "yes" ]; then
echo "INIT CMD = ${INIT_CMD}"
fi
}
@ -62,7 +69,7 @@ function detect_database () {
ADAPTER="mysql2"
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
if [ "${DEBUG}" == "yes" ]; then
echo "Use ${ADAPTER} adapter in database.yml"
fi
}
@ -94,7 +101,7 @@ function detect_webserver () {
fi
fi
if [ "${DEBUG_OUTPUT}" == "yes" ]; then
if [ "${DEBUG}" == "yes" ]; then
echo "Webserver is ${WEBSERVER_CMD}"
fi
}

View file

@ -5,14 +5,14 @@
PATH=/opt/zammad/bin:/opt/zammad/vendor/bundle/bin:/sbin:/bin:/usr/sbin:/usr/bin:
#set -e
# import config
. /opt/zammad/contrib/packager.io/config
# import functions
. /opt/zammad/contrib/packager.io/functions
debug
detect_os
detect_docker