Fix for burp v2

This commit is contained in:
Patrick Van der Veken 2019-03-11 12:54:32 +01:00
parent a2f1c51bea
commit 990d24962f

View File

@ -32,6 +32,7 @@
# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # @(#) 2019-01-24: arguments fix [Patrick Van der Veken]
# @(#) 2019-03-09: changed format of stanzas in configuration file & # @(#) 2019-03-09: changed format of stanzas in configuration file &
# @(#) added support for --log-healthy [Patrick Van der Veken] # @(#) added support for --log-healthy [Patrick Van der Veken]
# @(#) 2019-03-10: fix for burp v2
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING!
#****************************************************************************** #******************************************************************************
@ -43,7 +44,7 @@ function check_linux_burp_backup
typeset _BURP_SERVER_CONFIG_FILE="/etc/burp/burp-server.conf" typeset _BURP_SERVER_CONFIG_FILE="/etc/burp/burp-server.conf"
typeset _BURP_CLIENT_CONFIG_FILE="/etc/burp/burp.conf" typeset _BURP_CLIENT_CONFIG_FILE="/etc/burp/burp.conf"
typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf"
typeset _VERSION="2019-03-09" # YYYY-MM-DD typeset _VERSION="2019-03-10" # YYYY-MM-DD
typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
# ------------------------- CONFIGURATION ends here --------------------------- # ------------------------- CONFIGURATION ends here ---------------------------
@ -220,8 +221,6 @@ do
# ex.: # ex.:
# Backup: 0000078 2016-11-27 03:39:03 (deletable) # Backup: 0000078 2016-11-27 03:39:03 (deletable)
# Backup: 0000079 2016-12-04 03:59:04 # Backup: 0000079 2016-12-04 03:59:04
_BACKUP_STATS="$(${_BURP_BIN} -a l -C ${_BURP_CLIENT} 2>>${HC_STDERR_LOG} | grep '^Backup' | tail -n 1 | cut -f2- -d':')" _BACKUP_STATS="$(${_BURP_BIN} -a l -C ${_BURP_CLIENT} 2>>${HC_STDERR_LOG} | grep '^Backup' | tail -n 1 | cut -f2- -d':')"
if [[ -n "${_BACKUP_STATS}" ]] if [[ -n "${_BACKUP_STATS}" ]]
then then
@ -239,7 +238,7 @@ do
# get backup warnings # get backup warnings
case "${_BURP_VERSION}" in case "${_BURP_VERSION}" in
burp-2*) burp-2*)
# burp v2 does not support yet the 'burp -a S -C <client> -z backup_stats' action # burp v2 does not yet support the 'burp -a S -C <client> -z backup_stats' action
# so we need to find the backup_stats file ourselves # so we need to find the backup_stats file ourselves
# first check client override # first check client override
_BURP_BACKUP_DIR=""; _BURP_CLIENTCONF_DIR="" _BURP_BACKUP_DIR=""; _BURP_CLIENTCONF_DIR=""
@ -326,7 +325,17 @@ do
if (( _STC > 0 )) if (( _STC > 0 ))
then then
print "=== ${_BURP_CLIENT}: ${_BACKUP_RUN} ===" >>${HC_STDOUT_LOG} print "=== ${_BURP_CLIENT}: ${_BACKUP_RUN} ===" >>${HC_STDOUT_LOG}
case "${_BURP_VERSION}" in
burp-2*)
if [[ -r ${_BURP_BACKUP_DIR}/${_BURP_CLIENT}/current/log.gz ]]
then
zcat ${_BURP_BACKUP_DIR}/${_BURP_CLIENT}/current/log.gz >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
fi
;;
burp-1*)
${_BURP_BIN} -c ${_BURP_SERVER_CONFIG_FILE} -a S -C ${_BURP_CLIENT} -b ${_BACKUP_RUN} -z log.gz >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG} ${_BURP_BIN} -c ${_BURP_SERVER_CONFIG_FILE} -a S -C ${_BURP_CLIENT} -b ${_BACKUP_RUN} -z log.gz >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
;;
esac
fi fi
else else
warn "bad entry in the configuration file ${_CONFIG_FILE} on data line ${_COUNT}" warn "bad entry in the configuration file ${_CONFIG_FILE} on data line ${_COUNT}"