From e8be02436cf48f3509fb0f7e7443687e63b19daa Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Sun, 11 Dec 2016 21:05:18 +0100 Subject: [PATCH] Repaired preload --- lib/preload.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/preload.sh b/lib/preload.sh index f90f63c..1683694 100644 --- a/lib/preload.sh +++ b/lib/preload.sh @@ -9,6 +9,15 @@ . ${ZAF_LIB_DIR}/zbxapi.lib.sh . ${ZAF_LIB_DIR}/cache.lib.sh +if ! type zaf_version >/dev/null; then + echo "Problem loading libraries?" + exit 2 +fi + +zaf_debug_init +zaf_tmp_init +zaf_cache_init + # Global plugin parameters [ -f ./params ] && for p in $(cat ./params); do var=$p @@ -17,17 +26,6 @@ eval export $var="$value" done -# Plugin specific functions if exists -[ -f ./functions.sh ] && . ./functions.sh - -if ! type zaf_version >/dev/null; then - echo "Problem loading libraries?" - exit 2 -fi -zaf_debug_init -zaf_tmp_init -zaf_cache_init - export ZAF_LIB_DIR export ZAF_TMP_DIR export ZAF_CACHE_DIR @@ -36,6 +34,9 @@ export ZAF_DEBUG unset ZAF_LOG_STDERR export PATH +# Plugin specific functions if exists +[ -f ./functions.sh ] && . ./functions.sh + if [ "$(basename $0)" = "preload.sh" ] && [ -n "$*" ]; then tmpf=$(zaf_tmpfile preload) export tmpf