1
0
mirror of https://github.com/limosek/zaf.git synced 2024-11-14 06:29:07 +01:00

Repaired bug in install, version info

This commit is contained in:
Lukas Macura 2016-04-15 08:51:50 +02:00
parent ed5e0501b8
commit c830d0e6a0
3 changed files with 9 additions and 5 deletions

View File

@ -179,7 +179,7 @@ zaf_configure_agent() {
else
zaf_unset_agent_option "$option"
fi
options="$options Z_$option='$value'"
options="$options Z_$option=$value"
done
zaf_set_option ZAF_AGENT_OPTIONS "${options}"
}

View File

@ -267,13 +267,17 @@ zaf_install_plugin() {
local plugin
local plugindir
local control
local version
if zaf_prepare_plugin "$1" "${ZAF_TMP_DIR}/plugin"; then
url=$(zaf_get_plugin_url "$1")
plugin=$(zaf_ctrl_get_global_block <"${ZAF_TMP_DIR}/plugin/control.zaf" | zaf_block_get_option Plugin)
control="${ZAF_TMP_DIR}/plugin/control.zaf"
plugin=$(zaf_ctrl_get_global_option $control Plugin)
version=$(zaf_ctrl_get_global_option $control Version)
plugindir="${ZAF_PLUGINS_DIR}"/$plugin
if [ -n "$plugin" ] && zaf_prepare_plugin "$1" $plugindir; then
zaf_wrn "Installing plugin $plugin from $url to $plugindir"
zaf_wrn "Installing plugin $plugin version $version"
zaf_dbg "Source url: $url, Destination dir: $plugindir"
control=${plugindir}/control.zaf
[ "$ZAF_DEBUG" -gt 1 ] && zaf_plugin_info "${control}"
zaf_ctrl_check_deps "${control}"
@ -413,7 +417,7 @@ zaf_precache_item() {
zaf_remove_plugin() {
! zaf_is_plugin $1 && { zaf_err "Plugin $1 not installed!"; }
zaf_wrn "Removing plugin $1"
zaf_wrn "Removing plugin $1 (version $(zaf_plugin_version $1))"
rm -rf ${ZAF_PLUGINS_DIR}/$1
rm -f ${ZAF_AGENT_CONFIGD}/zaf_$1.conf ${ZAF_CROND}/zaf_$1 ${ZAF_SUDOERSD}/zaf_$1
}

View File

@ -44,7 +44,7 @@ zaf_zbxapi_login(){
local pass
local result
[ -z "$ZAF_ZBXAPI_URL" ] || [ -z "$ZAF_ZBXAPI_USER" ] || [ -z "$ZAF_ZBXAPI_PASS" ] && zaf_err "Zabbix Api parameters not set!"
[ -z "$ZAF_ZBXAPI_URL" ] || [ -z "$ZAF_ZBXAPI_USER" ] || [ -z "$ZAF_ZBXAPI_PASS" ] && zaf_err "Zabbix Api parameters not set! Set ZAF_ZBXAPI_URL, ZAF_ZBXAPI_USER and ZAF_ZBXAPI_PASS and try again."
authstr='{
"method" : "user.login",
"params" : {