Allowing multiple arguments for Read_conffile();.
This commit is contained in:
parent
705a4178e7
commit
0466a3bda4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue