[project @ peter@palfrader.org-20080414213832-potloz85vt4hpvgi]
[mirror/dsa-nagios.git] / dsa-nagios-nrpe-config / debian / postinst
index e96fdbf..5529e94 100644 (file)
@@ -38,6 +38,21 @@ if [ -e /etc/default/nagios-nrpe-server ] ; then
        fi
 fi
 
+if [ -e /etc/sudoers ] ; then
+       if ! grep '^nagios.*/usr/lib/nagios/plugins/dsa-check-dabackup' /etc/sudoers > /dev/null; then
+               echo
+               echo 'WARNIG: Add this line to sudoers:'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/dsa-check-dabackup ""'
+               echo
+       fi
+fi
+
+if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+       invoke-rc.d nagios-nrpe-server restart || exit $?
+else
+       /etc/init.d/nagios-nrpe-server restart || exit $?
+fi
+
 #DEBHELPER#
 
 exit 0