From 88b2946f6ef88c1f99ceb63775c0173935d34af5 Mon Sep 17 00:00:00 2001 From: Lars Wendler Date: Tue, 26 Feb 2019 16:38:15 +0100 Subject: apache2ctl: don't fail with mutli-line APACHE2_OPTS in conf.d file. Bug: https://bugs.gentoo.org/676990 Signed-off-by: Lars Wendler --- 2.4/scripts/apache2ctl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/2.4/scripts/apache2ctl b/2.4/scripts/apache2ctl index 6f5920d..9012520 100644 --- a/2.4/scripts/apache2ctl +++ b/2.4/scripts/apache2ctl @@ -8,9 +8,12 @@ RC_VERBS="start stop restart checkconfd configtest modules virtualhosts configdu load_rc_config() { [ -f "${APACHE_RC_CONF}" ] || return 1 - eval "export $(grep '^[[:space:]]*APACHE2_OPTS' ${APACHE_RC_CONF})" - eval $(grep '^[[:space:]]*SERVERROOT' ${APACHE_RC_CONF}) - eval $(grep '^[[:space:]]*CONFIGFILE' ${APACHE_RC_CONF}) + if ! grep -q '^[[:space:]]*APACHE2_OPTS' ${APACHE_RC_CONF} ; then + echo "Cannot find APACHE2_OPTS in ${APACHE_RC_CONF}" + exit 1 + fi + . ${APACHE_RC_CONF} + export APACHE2_OPTS export SERVERROOT="${SERVERROOT:-/usr/@LIBDIR@/apache2}" export CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}" } -- cgit v1.2.3-65-gdbad