| #!/bin/bash |
| # |
| # config: 234 40 |
| # @brief: Collect GUARD record information. |
| # |
| |
| # shellcheck disable=SC1091 |
| . "$DREPORT_INCLUDE"/functions |
| |
| desc="GUARD Records" |
| source /etc/profile.d/power-target.sh |
| |
| guard_part_file="/var/lib/phosphor-software-manager/hostfw/running/GUARD" |
| |
| # Check file is present and not empty. |
| if [ -e "$guard_part_file" ]; then |
| add_copy_file "$guard_part_file" "$desc" |
| fi |
| |
| # collect guarded list |
| guard_log_file=guard.log |
| if [ -e "/usr/bin/guard" ]; then |
| desc="Guard list" |
| add_cmd_output "echo $'[$desc]'" "$guard_log_file" "$desc" |
| add_cmd_output "/usr/bin/guard -l" "$guard_log_file" "$desc" |
| |
| desc="Guard resolved records" |
| add_cmd_output "echo $'\n[$desc]'" "$guard_log_file" "$desc" |
| add_cmd_output "/usr/bin/guard -a" "$guard_log_file" "$desc" |
| |
| desc="Guard ephemeral records" |
| add_cmd_output "echo $'\n[$desc]'" "$guard_log_file" "$desc" |
| add_cmd_output "/usr/bin/guard -e" "$guard_log_file" "$desc" |
| fi |