join source handling for --all and normal

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-07-23 17:47:54 +02:00
parent 8491a54b0d
commit f5e1920a15

View file

@ -181,22 +181,6 @@ fi
[ -d "${CCOLLECT_CONF}" ] || _exit_err "No configuration found in " \ [ -d "${CCOLLECT_CONF}" ] || _exit_err "No configuration found in " \
"\"${CCOLLECT_CONF}\" (is \$CCOLLECT_CONF properly set?)" "\"${CCOLLECT_CONF}\" (is \$CCOLLECT_CONF properly set?)"
#
# Capture sources in an "array"
#
while [ "$#" -ge 1 ]; do
eval arg=\"\$1\"; shift
if [ -z "$INTERVAL" ]; then
INTERVAL="$arg"
else
eval source_${no_sources}=\"${arg}\"
no_sources="$((${no_sources}+1))"
# make variable available for subscripts
eval export source_${no_sources}
fi
done
# #
# Look, if we should take ALL sources # Look, if we should take ALL sources
@ -204,6 +188,7 @@ done
if [ "${USE_ALL}" = 1 ]; then if [ "${USE_ALL}" = 1 ]; then
no_sources="0" no_sources="0"
if [ "${USE_ALL}" = 1 ]; then
# #
# get entries from sources # get entries from sources
# #
@ -215,6 +200,19 @@ if [ "${USE_ALL}" = 1 ]; then
eval source_${no_sources}=\"${tmp}\" eval source_${no_sources}=\"${tmp}\"
no_sources=$((${no_sources}+1)) no_sources=$((${no_sources}+1))
done < "${TMP}" done < "${TMP}"
else
#
# Get sources from command line
#
while [ "$#" -ge 1 ]; do
eval arg=\"\$1\"; shift
eval source_${no_sources}=\"${arg}\"
no_sources="$((${no_sources}+1))"
# make variable available for subscripts
eval export source_${no_sources}
done
fi fi
# #