mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-11-13 07:11:12 +01:00
Plugin directory: use "find" instead of "ls"
Relying on shell globbing is discouraged.
This commit is contained in:
parent
5de3df252e
commit
02b2eb861e
1 changed files with 5 additions and 4 deletions
|
@ -14,9 +14,10 @@ VERSION="@@VERSION@@"
|
|||
|
||||
@@CONF@@
|
||||
|
||||
# if plugindir_ is present in $PLUGINS,
|
||||
# iexecutables (scripts, binaries) matching the following pattern will be scanned and operated as plugins
|
||||
PLUGINPATTERN=$(dirname $0)"/munin-node-plugin.d/*"
|
||||
# if plugindir_ is present in $PLUGINS, executables (scripts, binaries) in the specified path
|
||||
# and matching the pattern will be scanned and operated as plugins
|
||||
PLUGIN_DIRECTORY="$(dirname "$0")/munin-node-plugin.d"
|
||||
PLUGINPATTERN="*"
|
||||
|
||||
# Remove unwanted plugins from this list
|
||||
PLUGINS="@@PLUGINS@@"
|
||||
|
@ -90,7 +91,7 @@ do
|
|||
RES="$RES netstat"
|
||||
fi
|
||||
elif [ "$PLUG" = "plugindir_" ]; then
|
||||
for MYPLUGIN in $(ls -1 $PLUGINPATTERN 2>/dev/null );
|
||||
for MYPLUGIN in $(if [ -d "$PLUGIN_DIRECTORY" ]; then find -L "$PLUGIN_DIRECTORY" -type f -name "$PLUGINPATTERN"; fi);
|
||||
do
|
||||
if [ -f $MYPLUGIN -a -x $MYPLUGIN ]; then
|
||||
MYPLUGINNAME=$(basename $MYPLUGIN)
|
||||
|
|
Loading…
Reference in a new issue