Code

patches/adjust-template-path: Added support for /etc/pnp4nagios/templates.d.
[pkg-pnp4nagios.git] / debian / patches / adjust-template-path
index 9e4beeb73f4d10abe84da6354925bb19db09a18d..263d9b5f11c3cba6359d1d2724dbdd1ac9a918d2 100644 (file)
@@ -1,15 +1,19 @@
 Description: Install templates into /etc/ rather than /usr/share/.
-Author: Sven Velt <sven@velt.de>
+ Also, add support for templates.d directory.
+Author: Sven Velt <sven@velt.de>, Sebastian Harl <tokkee@debian.org
 Forwarded: not-needed
 
 --- a/sample-config/pnp/config.php.in
 +++ b/sample-config/pnp/config.php.in
-@@ -214,12 +214,12 @@
+@@ -214,12 +214,15 @@
  # Add your own template directories here
  # First match wins!
  #$conf['template_dirs'][] = '/usr/local/check_mk/pnp-templates';
 -$conf['template_dirs'][] = '@datarootdir@/templates';
 +$conf['template_dirs'][] = '@sysconfdir@/templates';
++foreach (glob("/etc/pnp4nagios/templates.d/*", GLOB_ONLYDIR) as $dirname) {
++      $conf['template_dirs'][] = "$dirname";
++}
  $conf['template_dirs'][] = '@datarootdir@/templates.dist';
  
  #