Rollback some stuff + whitespace fixes
This commit is contained in:
parent
c8aa4aad79
commit
8b6b2e9c31
@ -30,7 +30,7 @@
|
|||||||
# RETURNS: 0
|
# RETURNS: 0
|
||||||
function version_include_core
|
function version_include_core
|
||||||
{
|
{
|
||||||
typeset _VERSION="2020-04-07" # YYYY-MM-DD
|
typeset _VERSION="2020-04-08" # YYYY-MM-DD
|
||||||
|
|
||||||
print "INFO: $0: ${_VERSION#version_*}"
|
print "INFO: $0: ${_VERSION#version_*}"
|
||||||
|
|
||||||
@ -758,7 +758,8 @@ do
|
|||||||
if (( ERROR_COUNT > 0 ))
|
if (( ERROR_COUNT > 0 ))
|
||||||
then
|
then
|
||||||
: >${TMP_FILE} 2>/dev/null
|
: >${TMP_FILE} 2>/dev/null
|
||||||
awk -F"${LOG_SEP}" -v OFS="${LOG_SEP}" '
|
# shellcheck disable=SC2002
|
||||||
|
cat ${FIX_FILE} 2>/dev/null | awk -F"${LOG_SEP}" -v OFS="${LOG_SEP}" '
|
||||||
|
|
||||||
BEGIN { max_log_fields = '"${NUM_LOG_FIELDS}"'
|
BEGIN { max_log_fields = '"${NUM_LOG_FIELDS}"'
|
||||||
max_fields = (max_log_fields - 1) * 2
|
max_fields = (max_log_fields - 1) * 2
|
||||||
@ -834,7 +835,7 @@ do
|
|||||||
# correct log line, no rewrite needed
|
# correct log line, no rewrite needed
|
||||||
print $0
|
print $0
|
||||||
}
|
}
|
||||||
}' ${FIX_FILE} >${TMP_FILE} 2>/dev/null
|
}' >${TMP_FILE} 2>/dev/null
|
||||||
|
|
||||||
# count after rewrite (include empty lines again in the count)
|
# count after rewrite (include empty lines again in the count)
|
||||||
TMP_COUNT=$(wc -l ${TMP_FILE} 2>/dev/null | cut -f1 -d' ' 2>/dev/null)
|
TMP_COUNT=$(wc -l ${TMP_FILE} 2>/dev/null | cut -f1 -d' ' 2>/dev/null)
|
||||||
@ -1529,8 +1530,8 @@ function is_scheduled
|
|||||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set "${DEBUG_OPTS}"
|
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set "${DEBUG_OPTS}"
|
||||||
typeset CRON_HC="${1}"
|
typeset CRON_HC="${1}"
|
||||||
typeset CRON_COUNT=0
|
typeset CRON_COUNT=0
|
||||||
typeset CRON_SYS_LOCATIONS="/etc/crontab /etc/cron.d/*"
|
typeset CRON_SYS_LOCATIONS='/etc/crontab /etc/cron.d/*'
|
||||||
typeset CRON_ANACRON_LOCATIONS="/etc/anacrontab /etc/cron.*"
|
typeset CRON_ANACRON_LOCATIONS='/etc/anacrontab /etc/cron.*'
|
||||||
|
|
||||||
# check for a scheduled job
|
# check for a scheduled job
|
||||||
case "${OS_NAME}" in
|
case "${OS_NAME}" in
|
||||||
@ -1553,6 +1554,7 @@ case "${OS_NAME}" in
|
|||||||
*)
|
*)
|
||||||
# use default root crontab
|
# use default root crontab
|
||||||
CRON_COUNT=$(crontab -l 2>/dev/null | grep -c -E -e "^[^#].*${CRON_HC}" 2>/dev/null)
|
CRON_COUNT=$(crontab -l 2>/dev/null | grep -c -E -e "^[^#].*${CRON_HC}" 2>/dev/null)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
return ${CRON_COUNT}
|
return ${CRON_COUNT}
|
||||||
@ -1703,7 +1705,8 @@ fi
|
|||||||
print "${FPATH}" | tr ':' '\n' 2>/dev/null | grep -v "core$" 2>/dev/null | sort 2>/dev/null |\
|
print "${FPATH}" | tr ':' '\n' 2>/dev/null | grep -v "core$" 2>/dev/null | sort 2>/dev/null |\
|
||||||
while read -r FDIR
|
while read -r FDIR
|
||||||
do
|
do
|
||||||
find ${FDIR} -name "${FNEEDLE}" 2>/dev/null | sort 2>/dev/null | while read -r FFILE
|
# shellcheck disable=SC2012
|
||||||
|
ls -1 ${FDIR}/${FNEEDLE} 2>/dev/null | sort 2>/dev/null | while read -r FFILE
|
||||||
do
|
do
|
||||||
# cache script contents in memory
|
# cache script contents in memory
|
||||||
FSCRIPT=$(<${FFILE})
|
FSCRIPT=$(<${FFILE})
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
function report_std
|
function report_std
|
||||||
{
|
{
|
||||||
# ------------------------- CONFIGURATION starts here -------------------------
|
# ------------------------- CONFIGURATION starts here -------------------------
|
||||||
typeset _VERSION="2020-04-07" # YYYY-MM-DD
|
typeset _VERSION="2020-04-08" # YYYY-MM-DD
|
||||||
typeset _SUPPORTED_PLATFORMS="AIX,HP-UX,Linux" # uname -s match
|
typeset _SUPPORTED_PLATFORMS="AIX,HP-UX,Linux" # uname -s match
|
||||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||||
|
|
||||||
@ -63,6 +63,7 @@ typeset _HC_REPORT_CACHE_LAST_STUB="${STATE_PERM_DIR}/cache.report-last"
|
|||||||
typeset _HC_REPORT_CACHE_LAST_FILE=""
|
typeset _HC_REPORT_CACHE_LAST_FILE=""
|
||||||
typeset _HC_REPORT_CACHE_TODAY_FILE="${STATE_PERM_DIR}/cache.report-today"
|
typeset _HC_REPORT_CACHE_TODAY_FILE="${STATE_PERM_DIR}/cache.report-today"
|
||||||
typeset _USE_CACHE=0
|
typeset _USE_CACHE=0
|
||||||
|
typeset _USE_ANY_CACHE=0
|
||||||
typeset _CACHE_NOTE_BIT=""
|
typeset _CACHE_NOTE_BIT=""
|
||||||
|
|
||||||
# set archive log stash (never use cache files)
|
# set archive log stash (never use cache files)
|
||||||
@ -166,6 +167,7 @@ then
|
|||||||
then
|
then
|
||||||
_LOG_STASH="${_HC_REPORT_CACHE_LAST_FILE}"
|
_LOG_STASH="${_HC_REPORT_CACHE_LAST_FILE}"
|
||||||
_USE_CACHE=1
|
_USE_CACHE=1
|
||||||
|
_USE_ANY_CACHE=1
|
||||||
(( ARG_DEBUG > 0 )) && debug "setting log stash to cache file at ${_HC_REPORT_CACHE_LAST_FILE}"
|
(( ARG_DEBUG > 0 )) && debug "setting log stash to cache file at ${_HC_REPORT_CACHE_LAST_FILE}"
|
||||||
else
|
else
|
||||||
(( ARG_DEBUG > 0 )) && debug "HC_REPORT_CACHE_LAST is enabled but unable to find cache file at ${_HC_REPORT_CACHE_LAST_FILE}"
|
(( ARG_DEBUG > 0 )) && debug "HC_REPORT_CACHE_LAST is enabled but unable to find cache file at ${_HC_REPORT_CACHE_LAST_FILE}"
|
||||||
@ -233,7 +235,7 @@ then
|
|||||||
# spacer
|
# spacer
|
||||||
print
|
print
|
||||||
# disclaimer & note(s)
|
# disclaimer & note(s)
|
||||||
if (( _USE_CACHE > 0 ))
|
if (( _USE_ANY_CACHE > 0 ))
|
||||||
then
|
then
|
||||||
print "NOTE: entries suffixed by (C) indicate results were retrieved from a cache file. If you wish to use "
|
print "NOTE: entries suffixed by (C) indicate results were retrieved from a cache file. If you wish to use "
|
||||||
print " the real log files then disable HC_REPORT_CACHE_LAST in ${CONFIG_FILE}"
|
print " the real log files then disable HC_REPORT_CACHE_LAST in ${CONFIG_FILE}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user