From a2c2b6841f29e09a4da4d55d7e690c011dd963db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 13 Nov 2007 21:09:34 +0100 Subject: Extending conffiles to allow config/., config/., as well as config/, config/. and config/.. --- functions/conffile.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/functions/conffile.sh b/functions/conffile.sh index bd5547e..f60abe2 100755 --- a/functions/conffile.sh +++ b/functions/conffile.sh @@ -11,16 +11,22 @@ set -e Read_conffile () { - FILE="${1}" + 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}" - if [ -f "${FILE}" ] - then - if [ -r "${FILE}" ] + for FILE in ${FILES} + do + if [ -f "${FILE}" ] then - Echo_debug "Reading configuration file ${FILE}" - . "${FILE}" - else - Echo_warning "Failed to read configuration file ${FILE}" + if [ -r "${FILE}" ] + then + Echo_debug "Reading configuration file ${FILE}" + . "${FILE}" + else + Echo_warning "Failed to read configuration file ${FILE}" + fi fi - fi + done } -- cgit v1.0