mirror of
https://github.com/limosek/zaf.git
synced 2024-11-21 18:09:06 +01:00
Merge branch '1.2' of github.com:limosek/zaf into 1.2
This commit is contained in:
commit
76ba5b9ad9
9
zaf
9
zaf
@ -52,6 +52,7 @@ if [ -f ./lib/zaf.lib.sh ]; then
|
|||||||
[ -f ./lib/zaf.${ZAF_OS}.sh ] && . ./lib/zaf.${ZAF_OS}.sh
|
[ -f ./lib/zaf.${ZAF_OS}.sh ] && . ./lib/zaf.${ZAF_OS}.sh
|
||||||
else
|
else
|
||||||
. ${ZAF_LIB_DIR}/zaf.lib.sh
|
. ${ZAF_LIB_DIR}/zaf.lib.sh
|
||||||
|
. ${ZAF_LIB_DIR}/plugin.lib.sh
|
||||||
. ${ZAF_LIB_DIR}/os.lib.sh
|
. ${ZAF_LIB_DIR}/os.lib.sh
|
||||||
. ${ZAF_LIB_DIR}/ctrl.lib.sh
|
. ${ZAF_LIB_DIR}/ctrl.lib.sh
|
||||||
. ${ZAF_LIB_DIR}/cache.lib.sh
|
. ${ZAF_LIB_DIR}/cache.lib.sh
|
||||||
@ -373,20 +374,20 @@ api)
|
|||||||
if [ -f "$ZAF_PLUGINS_DIR/$1/template.xml" ]; then
|
if [ -f "$ZAF_PLUGINS_DIR/$1/template.xml" ]; then
|
||||||
template="$ZAF_PLUGINS_DIR/$1/template.xml"
|
template="$ZAF_PLUGINS_DIR/$1/template.xml"
|
||||||
zaf_wrn "Importing template $template"
|
zaf_wrn "Importing template $template"
|
||||||
zaf_zbxapi_import_template $template || zaf_err "Error importing template"
|
zaf_zbxapi_import_config $template || zaf_err "Error importing template"
|
||||||
else
|
else
|
||||||
url="$(zaf_plugin_option $1 Template)"
|
url="$(zaf_plugin_option $1 Template)"
|
||||||
if [ -n "$url" ]; then
|
if [ -n "$url" ]; then
|
||||||
zaf_fetch_url $url | zaf_zbxapi_import_template || zaf_err "Error importing template"
|
zaf_fetch_url $url | zaf_zbxapi_import_config || zaf_err "Error importing template"
|
||||||
else
|
else
|
||||||
url="$(zaf_plugin_option $1 Url)"
|
url="$(zaf_plugin_option $1 Url)"
|
||||||
zaf_fetch_url $url/template.xml | zaf_zbxapi_import_template || zaf_err "Error importing template"
|
zaf_fetch_url $url/template.xml | zaf_zbxapi_import_config || zaf_err "Error importing template"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -f $1 ]; then
|
if [ -f $1 ]; then
|
||||||
zaf_wrn "Importing template $1"
|
zaf_wrn "Importing template $1"
|
||||||
zaf_zbxapi_import_template $1 || zaf_err "Error importing template"
|
zaf_zbxapi_import_config $1 || zaf_err "Error importing template"
|
||||||
else
|
else
|
||||||
zaf_err "Unknown plugin $1!"
|
zaf_err "Unknown plugin $1!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user