diff options
-rwxr-xr-x | functions/conffile.sh | 23 |
1 files 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 |