Simplify interval code.

Eight lines and two variables are removed which makes the code,
I think, easier to read.

The main motivation for this change, however, is that it makes
ccollect.sh more friendly to (future) auto interval selection.
The removed lines and variables assumed that the interval was
known prior to the start of the source loop.  With auto interval
selection, the selected interval can be different for each
source.
This commit is contained in:
jll2 2009-06-26 14:42:45 -07:00
parent 0b064e0565
commit 76e6094247

View file

@ -237,14 +237,6 @@ if [ -x "${CPREEXEC}" ]; then
[ "${ret}" -eq 0 ] || _exit_err "${CPREEXEC} failed. Aborting" [ "${ret}" -eq 0 ] || _exit_err "${CPREEXEC} failed. Aborting"
fi fi
#
# check default configuration
#
D_FILE_INTERVAL="${CDEFAULTS}/intervals/${INTERVAL}"
D_INTERVAL=$(cat "${D_FILE_INTERVAL}" 2>/dev/null)
# #
# Let's do the backup # Let's do the backup
# #
@ -346,7 +338,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
c_interval="$(cat "${backup}/intervals/${INTERVAL}" 2>/dev/null)" c_interval="$(cat "${backup}/intervals/${INTERVAL}" 2>/dev/null)"
if [ -z "${c_interval}" ]; then if [ -z "${c_interval}" ]; then
c_interval="${D_INTERVAL}" c_interval="$(cat "${CDEFAULTS}/intervals/${INTERVAL}" 2>/dev/null)"
if [ -z "${c_interval}" ]; then if [ -z "${c_interval}" ]; then
_exit_err "No definition for interval \"${INTERVAL}\" found. Skipping." _exit_err "No definition for interval \"${INTERVAL}\" found. Skipping."