From 76e6094247ee4ca08111f631c000a03cb2d993e5 Mon Sep 17 00:00:00 2001 From: jll2 Date: Fri, 26 Jun 2009 14:42:45 -0700 Subject: [PATCH] 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. --- ccollect.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index e842053..65e10d9 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -237,14 +237,6 @@ if [ -x "${CPREEXEC}" ]; then [ "${ret}" -eq 0 ] || _exit_err "${CPREEXEC} failed. Aborting" fi -# -# check default configuration -# - -D_FILE_INTERVAL="${CDEFAULTS}/intervals/${INTERVAL}" -D_INTERVAL=$(cat "${D_FILE_INTERVAL}" 2>/dev/null) - - # # Let's do the backup # @@ -346,7 +338,7 @@ while [ "${i}" -lt "${no_sources}" ]; do c_interval="$(cat "${backup}/intervals/${INTERVAL}" 2>/dev/null)" if [ -z "${c_interval}" ]; then - c_interval="${D_INTERVAL}" + c_interval="$(cat "${CDEFAULTS}/intervals/${INTERVAL}" 2>/dev/null)" if [ -z "${c_interval}" ]; then _exit_err "No definition for interval \"${INTERVAL}\" found. Skipping."