From 618cb4869b88eaa0a36e0f227dd15c6e7c969270 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 26 Feb 2026 13:05:01 -0800 Subject: [PATCH] Improve setup-qbittorent.zsh --- setup-qbittorent.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup-qbittorent.zsh b/setup-qbittorent.zsh index aa7cb40..e27b4e0 100755 --- a/setup-qbittorent.zsh +++ b/setup-qbittorent.zsh @@ -23,8 +23,15 @@ printf 'Using interface: %s\n' "${iface}" # <-A|-D> function do_rules { emulate -L zsh + function handle_error { + setopt noxtrace + echo Failed to add iptables rules + rm -f "${save_file}" + exit 1 + } + [[ "${1}" = -A ]] && trap handle_error INT ZERR PS4='Run: ' - setopt errexit xtrace + setopt xtrace doas iptables -t filter "${1}" FORWARD -i "${iface}" -o wg0-mullvad -j ACCEPT doas iptables -t nat "${1}" PREROUTING -d "${2}"/32 -p tcp -m tcp --dport 62000 \