Allowing multiple arguments for Read_conffile();.

This commit is contained in:
Daniel Baumann 2008-04-07 12:04:35 +02:00
parent af3aebda73
commit 8f2ad4fc97
1 changed files with 13 additions and 10 deletions

View File

@ -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