Delete empty error files at the end

This commit is contained in:
Jérémy Lecour 2023-08-01 22:48:49 +02:00 committed by Jérémy Lecour
parent d29aa7887c
commit a2976936bf
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY
2 changed files with 6 additions and 0 deletions

View file

@ -13,6 +13,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Added
* Store iptables/nft stderr output in special files
* … and delete the empty ones at the end
### Changed

View file

@ -762,6 +762,10 @@ task_systemctl() {
fi
}
clean_empty_error_file() {
find "${dump_dir}" -type f -name "*.err" -size 0 -delete
}
main() {
if [ -z "${dump_dir}" ]; then
echo "ERROR: You must provide the --dump-dir argument" >&2
@ -841,6 +845,7 @@ main() {
task_systemctl
fi
clean_empty_error_file
debug "=> Your dump is available at ${dump_dir}"
exit ${rc}