1*e57ee762SArtem Senichev#!/bin/bash
2*e57ee762SArtem Senichev#
3*e57ee762SArtem Senichev# config: 123 20
4*e57ee762SArtem Senichev# @brief: Collect host's logs
5*e57ee762SArtem Senichev#
6*e57ee762SArtem Senichev
7*e57ee762SArtem Senichev. ${DREPORT_INCLUDE}/functions
8*e57ee762SArtem Senichev
9*e57ee762SArtem SenichevDESCRIPTION="Host logs"
10*e57ee762SArtem SenichevLOGS_PATH="/var/lib/obmc/hostlogs"
11*e57ee762SArtem Senichev
12*e57ee762SArtem Senichevif [[ -d ${LOGS_PATH} ]]; then
13*e57ee762SArtem Senichev  # Flush currently collected messages
14*e57ee762SArtem Senichev  busctl --no-pager --verbose call \
15*e57ee762SArtem Senichev    xyz.openbmc_project.HostLogger /xyz/openbmc_project/HostLogger \
16*e57ee762SArtem Senichev    xyz.openbmc_project.HostLogger Flush
17*e57ee762SArtem Senichev  # Copy log directory
18*e57ee762SArtem Senichev  add_copy_file "${LOGS_PATH}" "${DESCRIPTION}"
19*e57ee762SArtem Senichevfi
20