1
0
mirror of https://github.com/limosek/zaf.git synced 2025-11-01 18:17:37 +01:00

Added postconf hook for openwrt systems

This commit is contained in:
Lukas Macura
2016-11-22 14:27:44 +01:00
parent cc244ef791
commit 5838292856
2 changed files with 16 additions and 5 deletions

View File

@@ -1,17 +1,17 @@
# Os related functions
zaf_configure_os_openwrt() {
zaf_preconfigure_os_openwrt() {
ZAF_AGENT_RESTART="zaf agent-config ; /etc/init.d/zabbix_agentd restart"
ZAF_AGENT_CONFIGD="/var/run/zabbix_agentd.conf.d/"
ZAF_AGENT_CONFIG="/etc/zabbix_agentd.conf"
ZAF_AGENT_PKG="zabbix-agentd"
ZAF_CURL_INSECURE=1
}
zaf_configure_os_beesip() {
zaf_configure_os_openwrt
zaf_preconfigure_os_beesip() {
zaf_preconfigure_os_openwrt
}
zaf_configure_os_freebsd() {
zaf_preconfigure_os_freebsd() {
ZAF_AGENT_PKG="zabbix3-agent"
ZAF_AGENT_CONFIG="/usr/local/etc/zabbix3/zabbix_agentd.conf"
ZAF_AGENT_CONFIGD="/usr/local/etc/zabbix3/zabbix_agentd.conf.d/"
@@ -20,6 +20,16 @@ zaf_configure_os_freebsd() {
ZAF_SUDOERSD="/usr/local/etc/sudoers.d"
}
zaf_postconfigure_os_openwrt() {
if ! grep -q "zaf agent-config" /etc/init.d/zabbix_agentd; then
sed -i 's/uci2config $NAME/uci2config $NAME; zaf agent-config/' /etc/init.d/zabbix_agentd
fi
}
zaf_postconfigure_os_beesip() {
zaf_postconfigure_os_openwrt
}
zaf_which() {
if which >/dev/null 2>/dev/null; then
which "$1"