From 30e047c02089fa964d4b4c5c571d6e91f14d3c57 Mon Sep 17 00:00:00 2001 From: litinoveweedle <15144712+litinoveweedle@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:08:09 +0100 Subject: [PATCH 1/2] Add cleanup function to ip6tables-restore script --- qbittorrent/rootfs/usr/local/sbin/ip6tables-restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qbittorrent/rootfs/usr/local/sbin/ip6tables-restore b/qbittorrent/rootfs/usr/local/sbin/ip6tables-restore index 9071cb34a..23bff73d3 100644 --- a/qbittorrent/rootfs/usr/local/sbin/ip6tables-restore +++ b/qbittorrent/rootfs/usr/local/sbin/ip6tables-restore @@ -7,8 +7,10 @@ if [[ ! -x "${REAL_IP6TABLES_RESTORE}" ]]; then fi cleanup() { + local exit_code=$? [[ -n "${RULES_FILE:-}" && -f "${RULES_FILE}" ]] && rm -f "${RULES_FILE}" [[ -n "${SANITIZED_FILE:-}" && -f "${SANITIZED_FILE}" ]] && rm -f "${SANITIZED_FILE}" + return $exit_code } trap cleanup EXIT From f3f4d2ef8115b8055cc2b6837d8ec6e974f1fc1c Mon Sep 17 00:00:00 2001 From: litinoveweedle <15144712+litinoveweedle@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:09:08 +0100 Subject: [PATCH 2/2] Implement cleanup for temporary files in iptables-restore Add cleanup function to remove temporary files on exit. --- qbittorrent/rootfs/usr/local/sbin/iptables-restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qbittorrent/rootfs/usr/local/sbin/iptables-restore b/qbittorrent/rootfs/usr/local/sbin/iptables-restore index bbe11f8f0..2219b563c 100644 --- a/qbittorrent/rootfs/usr/local/sbin/iptables-restore +++ b/qbittorrent/rootfs/usr/local/sbin/iptables-restore @@ -7,8 +7,10 @@ if [[ ! -x "${REAL_IPTABLES_RESTORE}" ]]; then fi cleanup() { + local exit_code=$? [[ -n "${RULES_FILE:-}" && -f "${RULES_FILE}" ]] && rm -f "${RULES_FILE}" [[ -n "${SANITIZED_FILE:-}" && -f "${SANITIZED_FILE}" ]] && rm -f "${SANITIZED_FILE}" + return $exit_code } trap cleanup EXIT