]> git.pld-linux.org Git - packages/nagios-plugin-check_raid.git/commitdiff
- version 2.1 with my excessive changes
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 9 Sep 2009 17:17:28 +0000 (17:17 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nagios-plugin-check_raid.spec -> 1.4

nagios-plugin-check_raid.spec

index 0f5b7ff0fbcb25251930531f0aa44bb1760eae53..69c12dbf2507f6d02cf5c2e5d5548802f52eacec 100644 (file)
@@ -1,10 +1,8 @@
-# TODO:
-# If you call 'check_raid -S' as root it will attempt to add the required lines to the sudoers file in order for itself to work.
 %define                plugin  check_raid
 Summary:       Nagios plugin to check current server's RAID status
 Name:          nagios-plugin-%{plugin}
-Version:       2.0
-Release:       0.2
+Version:       2.1
+Release:       0.5
 License:       Unknown
 Group:         Networking
 Source0:       %{plugin}
@@ -12,6 +10,7 @@ Source0:      %{plugin}
 URL:           http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_raid/details
 Source1:       %{plugin}.cfg
 Requires:      nagios-core
+Requires:      sudo
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -39,6 +38,18 @@ sed -e 's,@plugindir@,%{plugindir},' %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+if [ "$1" = 1 ]; then
+       # setup sudo rules on first install
+       %{plugindir}/%{plugin} -S || :
+fi
+
+%postun
+if [ "$1" = 0 ]; then
+       # remove all sudo rules related to us
+       %{__sed} -i -e '/CHECK_RAID/d' /etc/sudoers
+fi
+
 %files
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
This page took 0.042031 seconds and 4 git commands to generate.