]> arthur.barton.de Git - netdata.git/blobdiff - plugins.d/node.d.plugin
updated shebang for compatibility
[netdata.git] / plugins.d / node.d.plugin
index a1fa754faa959e1ba04c598b4a92779d915e4ba1..270351e4e5582cada1876edd54eb71d481d0c71b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 ':' //; exec "$(command -v nodejs || command -v node || command -v js || echo "ERROR node.js IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@"
 
 // shebang hack from:
@@ -42,12 +42,17 @@ var netdata = require('netdata');
 function pluginConfig(filename) {
        var f = path.basename(filename);
 
+       // node.d.plugin configuration
        var m = f.match('.plugin' + '$');
-       if(m === null) m = f.match('.node.js' + '$');
        if(m !== null)
                return netdata.options.paths.config + '/' + f.substring(0, m.index) + '.conf';
 
-       return netdata.options.paths.config + '/' + f + '.conf';
+       // node.d modules configuration
+       m = f.match('.node.js' + '$');
+       if(m !== null)
+               return netdata.options.paths.config + '/node.d/' + f.substring(0, m.index) + '.conf';
+
+       return netdata.options.paths.config + '/node.d/' + f + '.conf';
 }
 
 // internal defaults