[packages/nagios-plugins/unified-plugindir: 2/3] add trigger to fixup old configs

glen glen at pld-linux.org
Mon Apr 27 23:16:26 CEST 2015


commit 6101a43de63b8b3a3148f75695789bee5002ce7e
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Apr 27 23:57:27 2015 +0300

    add trigger to fixup old configs

 nagios-plugins.spec | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/nagios-plugins.spec b/nagios-plugins.spec
index 79dda95..89e3bc0 100644
--- a/nagios-plugins.spec
+++ b/nagios-plugins.spec
@@ -631,6 +631,17 @@ rm -rf $RPM_BUILD_ROOT
 %triggerun -n nagios-plugin-check_mailq -- nagios-nrpe
 %nagios_nrpe -d check_mailq -f %{_sysconfdir}/check_mailq.cfg
 
+%if "%{_lib}" != "lib"
+%triggerpostun -- nagios-plugins < 2.0.3-3.2
+# update path to plugin in config if neccessary
+for c in \
+	%{_sysconfdir}/check_{dhcp,disk,dns,dummy,file_age,ftp,hpjd,http,imap,ircd,load,mailq,mrtgtraf,mysql,nntp,nt,ntp,ping,pop,procs,smtp,snmp,ssh,swap,tcp,telnet,udp,users} \
+; do
+	grep -q 'command_line.*%{_prefix}/%{_lib}/nagios/plugins' $c || continue
+	%{__sed} -i -e '/command_line/ s,%{_prefix}/%{_lib}/nagios/plugins,%{plugindir},g' $c
+done
+%endif
+
 %files -f %{name}.lang
 %defattr(644,root,root,755)
 %doc ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugins.git/commitdiff/40948309a7f28cd8541888df04d94240ce696a37



More information about the pld-cvs-commit mailing list