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_WEBS="1"
ZAMMAD_WEBSOCKETS="1" ZAMMAD_WEBSOCKETS="1"
ZAMMAD_WORKERS="1" ZAMMAD_WORKERS="1"
DEBUG_OUTPUT="no" DEBUG="no"

View file

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

View file

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