From 0466a3bda47a07e72e40648e5318567af389364c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 7 Apr 2008 12:04:35 +0200 Subject: Allowing multiple arguments for Read_conffile();. --- functions/conffile.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/functions/conffile.sh b/functions/conffile.sh index 17121b8..4c233a0 100755 --- a/functions/conffile.sh +++ b/functions/conffile.sh @@ -15,22 +15,25 @@ Read_conffile () then FILES="${LH_CONFIG}" else - FILES="${1} ${1}.${LH_ARCHITECTURE} ${1}.${DISTRIBUTION}" - FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lh_||')" - FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lh_||').${ARCHITECTURE}" - FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lh_||').${DISTRIBUTION}" + for FILE in ${@} + do + FILES="${FILE} ${FILE}.${LH_ARCHITECTURE} ${FILE}.${DISTRIBUTION}" + FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lh_||')" + FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lh_||').${ARCHITECTURE}" + FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lh_||').${DISTRIBUTION}" + done fi - for FILE in ${FILES} + for CONFFILE in ${FILES} do - if [ -f "${FILE}" ] + if [ -f "${CONFFILE}" ] then - if [ -r "${FILE}" ] + if [ -r "${CONFFILE}" ] then - Echo_debug "Reading configuration file ${FILE}" - . "${FILE}" + Echo_debug "Reading configuration file ${CONFFILE}" + . "${CONFFILE}" else - Echo_warning "Failed to read configuration file ${FILE}" + Echo_warning "Failed to read configuration file ${CONFFILE}" fi fi done -- cgit v1.0