app-admin/collectd: Fix oracle configuration check in init script _checkconfig.
authorAlexis Ballier <aballier@gentoo.org>
Mon, 4 Apr 2016 17:33:38 +0000 (19:33 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Mon, 4 Apr 2016 17:33:38 +0000 (19:33 +0200)
Do not match if oracle plugin is not enabled, simplify a bit the expression and use wc -l instead of grep --count so that it works with busybox too.

Package-Manager: portage-2.2.28
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
app-admin/collectd/files/collectd.initd-r1

index a90ec507eefcb93444ccb21270646f15d6432978..32510ffde9b025c7268a7a4851d803ea5922c788 100644 (file)
@@ -28,7 +28,7 @@ depend() {
 }
 
 _checkconfig() {
-       if [ $(eval sed '/^$\|^#/d' \"${COLLECTD_CONFIGFILE}\" | grep --count 'LoadPlugin[[:space:]]\+oracle') -ge 1 ] ; then
+       if [ $(sed '/^$\|^#/d' "${COLLECTD_CONFIGFILE}" | grep 'LoadPlugin[[:space:]]\+oracle' | wc -l) -ge 1 ] ; then
                if [ -e /etc/env.d/50oracle-instantclient-basic ] ; then
                        . /etc/env.d/50oracle-instantclient-basic
                        export ORACLE_HOME